flux.cli.argparse module
- class flux.cli.argparse.FluxArgumentParser(*args, posix=False, raw_description=False, argwidth=40, **kwargs)
Bases:
ArgumentParserArgumentParser with Flux defaults: allow_abbrev=False, FluxHelpFormatter.
- Additional keyword arguments:
- raw_description (bool): preserve whitespace in description/epilog.
Silently ignored if formatter_class is passed explicitly.
- argwidth (int): max column for help alignment (default 40).
Silently ignored if formatter_class is passed explicitly.
- posix (bool): stop consuming options at the first non-option argument
(POSIX getopt behavior). Intended for submission commands where tokens after the job command must not be consumed as Flux options. posix=True requires exactly one trailing positional with nargs=argparse.REMAINDER and supports no other positionals. Clustered short options whose last option takes a separate value (e.g.
-vn 4) are not supported in posix mode and will error; use-vn4or-v -n 4instead.
- add_argument() accepts an extra keyword argument:
- hidden_aliases (tuple): option strings recognized by the parser but
suppressed from --help output (e.g. singular forms of plural flags). Must be a tuple or list; passing a bare string raises TypeError.
- add_argument(dest, ..., name=value, ...)
- add_argument(option_string, option_string, ..., name=value, ...) None
- add_argument_group(*args, **kwargs)
- add_mutually_exclusive_group(**kwargs)
- parse_args(args=None, namespace=None)