class documentation

class Argument(Parameter):

View In Hierarchy

Arguments are positional parameters to a command. They generally provide fewer features than options but can have infinite nargs and are required by default.

All parameters are passed onwards to the parameter constructor.

Method __init__ Undocumented
Method ​_parse​_decls Undocumented
Method add​_to​_parser Undocumented
Method get​_error​_hint Get a stringified version of the param for use in error messages to indicate which param caused the error.
Method get​_usage​_pieces Undocumented
Method make​_metavar Undocumented
Class Variable param​_type​_name Undocumented
Property human​_readable​_name Returns the human readable name of this parameter. This is the same as the name for options, but the metavar for arguments.

Inherited from Parameter:

Method __repr__ Undocumented
Method consume​_value Undocumented
Method get​_default Get the default for the parameter. Tries Context.lookup_default first, then the local default.
Method get​_help​_record Undocumented
Method handle​_parse​_result Undocumented
Method process​_value Undocumented
Method resolve​_envvar​_value Undocumented
Method shell​_complete No summary
Method to​_info​_dict Gather information that could be useful for a tool generating user-facing documentation.
Method type​_cast​_value Convert and validate a value against the option's type, multiple, and nargs.
Method value​_from​_envvar Undocumented
Method value​_is​_missing Undocumented
Instance Variable ​_custom​_shell​_complete Undocumented
Instance Variable callback Undocumented
Instance Variable default Undocumented
Instance Variable envvar Undocumented
Instance Variable expose​_value Undocumented
Instance Variable is​_eager Undocumented
Instance Variable metavar Undocumented
Instance Variable multiple Undocumented
Instance Variable name Undocumented
Instance Variable nargs Undocumented
Instance Variable opts Undocumented
Instance Variable required Undocumented
Instance Variable secondary​_opts Undocumented
Instance Variable type Undocumented
def __init__(self, param_decls, required=None, **attrs):

Undocumented

Parameters
param​_decls:t.Sequence[str]Undocumented
required:t.Optional[bool]Undocumented
**attrs:t.AnyUndocumented
def _parse_decls(self, decls, expose_value):

Undocumented

Parameters
decls:t.Sequence[str]Undocumented
expose​_value:boolUndocumented
Returns
t.Tuple[t.Optional[str], t.List[str], t.List[str]]Undocumented
def add_to_parser(self, parser, ctx):

Undocumented

Parameters
parser:OptionParserUndocumented
ctx:ContextUndocumented
def get_error_hint(self, ctx):
Get a stringified version of the param for use in error messages to indicate which param caused the error.
Parameters
ctx:ContextUndocumented
Returns
strUndocumented
def get_usage_pieces(self, ctx):

Undocumented

Parameters
ctx:ContextUndocumented
Returns
t.List[str]Undocumented
def make_metavar(self):

Undocumented

Returns
strUndocumented
param_type_name: str =

Undocumented

@property
human_readable_name: str =
Returns the human readable name of this parameter. This is the same as the name for options, but the metavar for arguments.