tyro._backends._tyro_help_formatting¶
Help formatting utils used for argparse backend.
Module Contents¶
- tyro._backends._tyro_help_formatting.format_help(prog: str, parser_spec: tyro._parsers.ParserSpecification, args: list[tyro._parsers.ArgWithContext], subparser_frontier: dict[str, tyro._parsers.SubparsersSpecification]) list[str][source]¶
- Parameters:
prog (str)
parser_spec (tyro._parsers.ParserSpecification)
args (list[tyro._parsers.ArgWithContext])
subparser_frontier (dict[str, tyro._parsers.SubparsersSpecification])
- Return type:
- tyro._backends._tyro_help_formatting.recursive_arg_search(args: list[str], parser_spec: tyro._parsers.ParserSpecification, prog: str, unrecognized_arguments: set[str]) tuple[list[_ArgumentInfo], bool, bool][source]¶
Recursively search for arguments in a ParserSpecification. Used for error message printing.
Returns a list of arguments, whether the parser has subcommands or not, and – if unrecognized_arguments is passed in — whether an unrecognized argument exists under a different subparser.
- Parameters:
- Return type:
- tyro._backends._tyro_help_formatting.unrecognized_args_error(prog: str, unrecognized_args_and_progs: list[tuple[str, str]], args: list[str], parser_spec: tyro._parsers.ParserSpecification, console_outputs: bool, add_help: bool) NoReturn[source]¶
- tyro._backends._tyro_help_formatting.required_args_error(prog: str, required_args: list[tyro._parsers.ArgWithContext], unrecognized_args_and_progs: list[tuple[str, str]], console_outputs: bool, add_help: bool) NoReturn[source]¶