diff --git a/asciinema/__main__.py b/asciinema/__main__.py index fa0170e..0642d47 100644 --- a/asciinema/__main__.py +++ b/asciinema/__main__.py @@ -222,10 +222,10 @@ For help on a specific command run: # create the parser for the `cat` command parser_cat = subparsers.add_parser( - "cat", help="Print full output of terminal session" + "cat", help="Print full output of terminal sessions" ) parser_cat.add_argument( - "filename", help='local path, http/ipfs URL or "-" (read from stdin)' + "filename", nargs="+", help='local path, http/ipfs URL or "-" (read from stdin)' ) parser_cat.set_defaults(cmd=CatCommand) diff --git a/asciinema/commands/cat.py b/asciinema/commands/cat.py index b681d65..6c9327c 100644 --- a/asciinema/commands/cat.py +++ b/asciinema/commands/cat.py @@ -10,7 +10,7 @@ from .command import Command class CatCommand(Command): def __init__(self, args: Any, config: Config, env: Dict[str, str]): Command.__init__(self, args, config, env) - self.filename = args.filename + self.filenames = args.filename def execute(self) -> int: try: @@ -22,10 +22,11 @@ class CatCommand(Command): def cat(self) -> int: try: - with asciicast.open_from_url(self.filename) as a: - for _, _type, text in a.events("o"): - sys.stdout.write(text) - sys.stdout.flush() + for filename in self.filenames: + with asciicast.open_from_url(filename) as a: + for _, _type, text in a.events("o"): + sys.stdout.write(text) + sys.stdout.flush() except asciicast.LoadError as e: self.print_error(f"printing failed: {str(e)}")