microprobe.utils.cmdline.CLI
- class CLI(description, **kwargs)[source]
Bases:
objectObject to define a Command Line Interface.
Methods
__init__(description, **kwargs)Create a new command line parser.
add_description(text)Add more text to the description.
add_epilog(text)Add an epilog to the help message.
add_flag(name, short, descr[, group, configfile])Add a boolean flag.
add_group(name, description)Add an option group.
add_option(name, short, default, descr[, ...])Add an option that takes an argument.
get(name)main(options, main, *args, **kwargs)Main wrapper with common error control.
save(filename[, full])Attributes
Dictionary mapping arguments to values.
- property arg_parser
- property arguments
Dictionary mapping arguments to values.
- add_description(text)[source]
Add more text to the description.
- Parameters:
text (str) – Additional description text.
- add_epilog(text)[source]
Add an epilog to the help message.
- Parameters:
text (str) – Additional description text.
- add_group(name, description)[source]
Add an option group.
Allows the organization of options into groups.
- add_option(name, short, default, descr, opt_type=<class 'str'>, action=None, choices=None, group=None, metavar=None, required=False, nargs=None, configfile=True)[source]
Add an option that takes an argument.
See
argparsefor extended help.- Parameters:
name (str or
None) – Name of the option. IfNone, uses short as the name forget().short (str or
None) – Single-char name of the option.default – Default value.
descr (str) – Description of the option.
type – Option type (see python’s
argparsedocumentation).action – Action when flag is given (see python’s
argparsedocumentation).choices – Valid option values if type is
choice.group (str) – Name of the option group of this option.
You cannot have both name and short with a
Nonevalue.