Expand description
The part of Python’s argparse (CPython 3.13) that the fontTools command
lines use: parsing the arguments as ArgumentParser.parse_args does, with
its error messages.
The arguments are declared as with add_argument (Argument): options
with abbreviable long names and combinable short names, positional
arguments with nargs, type=float/type=int values, mutually exclusive
groups (Argument::group). parse follows _parse_known_args: the
positional arguments are matched against the pattern of the arguments
between the options, as argparse does with regular expressions.
The help and usage texts are not generated: Command holds them as
fontTools prints them, and prints them as argparse does
(print_help, error), through program_text.
Structs§
- Argument
- An argument (
add_argument). - Command
- A command line declared with
argparse: itsprog, its module (forprogram_text), its help text asargparseprints it, and its arguments. - Parsed
- The parsed command line, by
Argument::key. - Seen
- The values of an argument given on the command line.
Enums§
- Action
- What an argument does when it is given (
action=). - Nargs
- How many values an argument takes (
nargs=). - Ty
- The
typeof an argument’s values, checked when they are taken.
Functions§
- parse
- Parses
argsasArgumentParser.parse_argsdoes, for the declaredarguments;required_groupsare the mutually exclusive groups withrequired=True.Errholds the message ofparser.error. - parse_
float type=float: the value, or the message of the error for the argumentdisplay(seeArgument::display).- parse_
int type=int: the value, or the message of the error for the argumentdisplay(seeArgument::display).