file_output#
Abstract base class for subcommands that output to a file (or stdout).
- class FileOutputSubcommand(parser: ArgumentParser)[source]#
Abstract subcommand to output applications as some type of file.
- classmethod files_arg(output_type_name: str) tuple[str | tuple[str, ...], Argument][source]#
Returns a positional arg for
filesto specify file inputs to the command.Subclasses should include this to their class
args.Example
class Foo(FileOutputSubcommand): args = ( FileOutputSubcommand.files_arg("FOO"), # more args for Foo ) + FileOutputSubcommand.other_args()
- classmethod other_args() tuple[tuple[str | tuple[str, ...], Argument], ...][source]#
Return args for
-o/--outputto specify where output should be written, and for a--argsto pass on any additional command line args to the subcommand.Subclasses should append these to their class
args.Example
class Foo(FileOutputSubcommand): args = ( FileOutputSubcommand.files_arg("FOO"), # more args for Foo ) + FileOutputSubcommand.other_args()