pyTooling.CLIAbstraction.ValuedFlag

Valued flags are arguments with a name and an always present value.

The usual delimiter sign between name and value is an equal sign (=).

See also

  • For simple flags.
    Flag

  • For flags with different pattern based on the boolean value itself.
    BooleanFlag

  • For flags that have an optional value.
    NamedOptionalValuedFlag

  • For list of valued flags.
    ValuedFlagList

Classes

  • ValuedFlag: Class and base-class for all ValuedFlag classes, which represents a flag argument with value.

  • ShortValuedFlag: Represents a ValuedFlagArgument with a single dash.

  • LongValuedFlag: Represents a ValuedFlagArgument with a double dash.

  • WindowsValuedFlag: Represents a ValuedFlagArgument with a single slash.


Classes

class pyTooling.CLIAbstraction.ValuedFlag.ValuedFlag[source]

Class and base-class for all ValuedFlag classes, which represents a flag argument with value.

A valued flag is a flag name followed by a value. The default delimiter sign is equal (=). Name and value are passed as one argument to the executable even if the delimiter sign is a whitespace character.

Example:

  • width=100

Inheritance

Inheritance diagram of ValuedFlag

static __new__(cls, *args, **kwargs)[source]
Parameters:
AsArgument()

Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.

Return type:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (ValueT)

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

class pyTooling.CLIAbstraction.ValuedFlag.ShortValuedFlag[source]

Represents a ValuedFlagArgument with a single dash.

Example:

  • -optimizer=on

Inheritance

Inheritance diagram of ShortValuedFlag

static __new__(cls, *args, **kwargs)[source]
Parameters:
AsArgument()

Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.

Return type:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (ValueT)

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

class pyTooling.CLIAbstraction.ValuedFlag.LongValuedFlag[source]

Represents a ValuedFlagArgument with a double dash.

Example:

  • --optimizer=on

Inheritance

Inheritance diagram of LongValuedFlag

static __new__(cls, *args, **kwargs)[source]
Parameters:
AsArgument()

Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.

Return type:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (ValueT)

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

class pyTooling.CLIAbstraction.ValuedFlag.WindowsValuedFlag[source]

Represents a ValuedFlagArgument with a single slash.

Example:

  • /optimizer:on

Inheritance

Inheritance diagram of WindowsValuedFlag

static __new__(cls, *args, **kwargs)[source]
Parameters:
AsArgument()

Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.

Return type:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (ValueT)

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Argument formatted and enclosed in double quotes.