Expander
Expander¶
- class Expander[source]¶
Bases:
configpile.arg.Arg
Command-line argument that expands into a flag/value pair
Attributes
Note: attributes inherited from parent classes are not shown here, if any
Inserted flag in the command line
Inserted value in the command line
Methods
Returns a sequence of all forms of command line flags
Returns the keyword arguments for use with argparse.ArgumentParser.add_argument
Returns the flag/value pair that is inserted when this command flag is present
Constructs an expander that inserts a flag/value pair in the command line
Returns updated values for this argument, used during
App
constructionUpdates a config processor with the processing required by this argument
Returns a copy of this argument with some data updated from its declaration context
List of members of Expander
- update_processor(pf)[source]¶
Updates a config processor with the processing required by this argument
- Parameters
pf (
ProcessorFactory
[TypeVar
(_Config
, bound=Config
)]) – Processor factory- Return type
- static make(new_flag, new_value, *, help=None, short_flag_name=None, long_flag_name=Derived.KEBAB_CASE)[source]¶
Constructs an expander that inserts a flag/value pair in the command line
At least one of
short_flag_name
orlong_flag_name
must be defined.- Parameters
- Keyword Arguments
help – Help description (autodoc/docstring is used otherwise)
short_flag_name – Short flag name of this command flag
long_flag_name – Long flag name of this command flag
- Return type
- argparse_argument_kwargs()[source]¶
Returns the keyword arguments for use with argparse.ArgumentParser.add_argument
- __init__(help, short_flag_name, long_flag_name, new_flag, new_value)¶
- update_dict_(name, help, env_prefix)¶
Returns updated values for this argument, used during
App
construction- Parameters
Returns:
- updated(name, help, env_prefix)¶
Returns a copy of this argument with some data updated from its declaration context
- short_flag_name: Optional[str]¶
Short option name, used in command line parsing, prefixed by a single hyphen
- long_flag_name: Optional[Union[str, configpile.enums.Derived]]¶
Long option name used in command line argument parsing
It is in general lowercase, prefixed with
--
and words are separated by hyphens.,If set to