Option_Strings Module

Containers for option strings

author:

Doug Skrypa

class cli_command_parser.parameters.option_strings.OptionStrings(option_strs: ~typing.Collection[str], name_mode: ~cli_command_parser.config.OptionNameMode | str | None = <object object>)[source]

Bases: object

Container for the option strings registered for a given BaseOption (or subclass thereof).

name_mode: OptionNameMode | None
combinable: set[str]
has_long() Bool[source]

Whether any (primary / non-alternate, for TriFlag) long option strings were defined

has_min_opts() Bool[source]

Returns a truthy value if the minimum required number of option strings have been registered

update(name: str)[source]

Called by BaseOption.__set_name__() to add the assigned name to the long option strings for this param.

get_sets() tuple[set[str], set[str]][source]
property long: list[str][source]
property short: list[str][source]
property display_long: list[str][source]
get_usage_opt() str[source]
option_strs() Iterator[str][source]
all_option_strs() Iterator[str]
class cli_command_parser.parameters.option_strings.TriFlagOptionStrings(option_strs: ~typing.Collection[str], name_mode: ~cli_command_parser.config.OptionNameMode | str | None = <object object>)[source]

Bases: OptionStrings

Container for the option strings registered for a given TriFlag.

has_long() Bool[source]

Whether any primary / non-alternate long option strings were defined

has_min_opts() Bool[source]
add_alts(prefix: str | None, long: str | None, short: str | None)[source]
update_alts(name: str)[source]

Called by TriFlag.__set_name__() to add the assigned name to the alt long option strings for this param.

property alt_allowed: set[str][source]
property display_long_primary: list[str][source]
property short_primary: list[str][source]
property display_long_alt: list[str][source]
property short_alt: list[str][source]
primary_option_strs() Iterator[str][source]
alt_option_strs() Iterator[str][source]
get_usage_opt(alt: bool = False) str[source]
option_strs(alt: bool = False) Iterator[str][source]
all_option_strs() Iterator[str][source]