import click


@click.command()
@click.option('-i', '--input', multiple=True, type=click.Path(readable=True))
@click.option('-o', '--output', default='-', type=click.Path(writable=True))
def cli(input, output):
    """ CaTeX concatenates LateX documents.
    """
    from core import merge
    output.write(merge(input))


if __name__ == '__main__':
    cli()

@@ -101,16 +101,65 @@
 le=True)
+,%0A              help='Paths of the .tex to merge'
 )%0A@click
@@ -212,27 +212,85 @@
 ick.
-Path(writable=True)
+File('wb'),%0A              help='Path for the output file (default is stdout)'
 )%0Ade
@@ -390,16 +390,16 @@
 t merge%0A
-
     outp
@@ -413,16 +413,17 @@
 e(merge(
+*
 input))%0A

fix bug in cli.