command_creator.CmdArgument

class command_creator.CmdArgument(help: str = '', abrv: str | None = None, choices: list[~typing.Any] | type[~enum.Enum] | None = None, metavar: str | None = None, optional: bool = False, positional: bool = False, default: ~typing.Any = <dataclasses._MISSING_TYPE object>, default_factory: ~typing.Callable[[], ~typing.Any] = <function CmdArgument.<lambda>>, init: bool = True, repr: bool = True, hash: bool | None = None, compare: bool = True, count: bool = False, completer: ~typing.Callable[[~typing.Unpack[~command_creator.CompleterArgs]], ~typing.List[str] | ~typing.Dict[str, str]] | ~typing.Dict[str, str] | ~typing.List[str] | None = None, metadata: ~typing.Mapping[~typing.Any, ~typing.Any] = {}, **kwargs: ~typing.Any)

Bases: Field

Class which represents a command-line argument

__init__(help: str = '', abrv: str | None = None, choices: list[~typing.Any] | type[~enum.Enum] | None = None, metavar: str | None = None, optional: bool = False, positional: bool = False, default: ~typing.Any = <dataclasses._MISSING_TYPE object>, default_factory: ~typing.Callable[[], ~typing.Any] = <function CmdArgument.<lambda>>, init: bool = True, repr: bool = True, hash: bool | None = None, compare: bool = True, count: bool = False, completer: ~typing.Callable[[~typing.Unpack[~command_creator.CompleterArgs]], ~typing.List[str] | ~typing.Dict[str, str]] | ~typing.Dict[str, str] | ~typing.List[str] | None = None, metadata: ~typing.Mapping[~typing.Any, ~typing.Any] = {}, **kwargs: ~typing.Any) None

Methods

__init__([help, abrv, choices, metavar, ...])

get_default()

Attributes

help

The help string used for the argument

abrv

The abbreviation for the argument, if any

choices

The choices for the argument, if any

optional

Whether the argument is optional

positional

Whether the argument is positional

count

Whether the argument is a count

completer

The argcomplete completer for the argument, if any

metavar

The metavar for the argument, if any

compare

default

default_factory

hash

init

kw_only

metadata

name

repr

type

abrv

The abbreviation for the argument, if any

choices

The choices for the argument, if any

completer

The argcomplete completer for the argument, if any

count

Whether the argument is a count

help

The help string used for the argument

metavar

The metavar for the argument, if any

optional

Whether the argument is optional

positional

Whether the argument is positional