argclz.core.Argument#
- class argclz.core.Argument[source]#
Bases:
object(internal) Do not use class directly.
Commandline argument descriptor (https://docs.python.org/3/glossary.html#term-descriptor). Carried the arguments pass to
argparse.ArgumentParser.add_argument.Methods Summary
__init__(*options[, validator, group, ...])add_argument(ap, instance)Add this into argparse.ArgumentParser.
with_options(*options, **kwargs)Modify or update keyword parameter and return a new argument.
Attributes Summary
Details
- property default#
- property const#
- add_argument(ap, instance)[source]#
Add this into argparse.ArgumentParser.
- Parameters:
ap (_ActionsContainer)
instance
- Returns:
- with_options(*options, **kwargs)[source]#
Modify or update keyword parameter and return a new argument.
option flags update rule:
(),(...): do not update options('-a', '-b'): replace options(..., '-c'): additional options({'-a': '-A'}): rename options({'-a': ...}): remove options({'-a': '-A', '-b': ...}, '-c'): rename ‘-a’, remove ‘-b’, add ‘-c’
general form:
() | (dict?, ...?, *str)- Parameters:
options – change option flags
kwargs – change keyword parameters, use … to unset parameter
- Returns:
- Return type:
Self