pyTooling.CLIAbstraction.KeyValueFlag
Flag arguments represent simple boolean values by being present or absent.
See also
For flags with different pattern based on the boolean value itself.
→BooleanFlag
For flags with a value.
→ValuedFlag
For flags that have an optional value.
→NamedOptionalValuedFlag
Classes
NamedKeyValuePairsArgument
: Class and base-class for all KeyValueFlag classes, which represents a flag argument with key and valueShortKeyValueFlag
: Represents aNamedKeyValueFlagArgument
with a single dash in front of the switch name.LongKeyValueFlag
: Represents aNamedKeyValueFlagArgument
with a double dash in front of the switch name.WindowsKeyValueFlag
: Represents aNamedKeyValueFlagArgument
with a double dash in front of the switch name.
Classes
- class pyTooling.CLIAbstraction.KeyValueFlag.NamedKeyValuePairsArgument[source]
Class and base-class for all KeyValueFlag classes, which represents a flag argument with key and value (key-value-pairs).
An optional 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. If the value is None, no delimiter sign and value is passed.Example:
-gWidth=100
Inheritance
- AsArgument()[source]
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.KeyValueFlag.ShortKeyValueFlag[source]
Represents a
NamedKeyValueFlagArgument
with a single dash in front of the switch name.Example:
-DDEBUG=TRUE
Inheritance
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.KeyValueFlag.LongKeyValueFlag[source]
Represents a
NamedKeyValueFlagArgument
with a double dash in front of the switch name.Example:
--DDEBUG=TRUE
Inheritance
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.KeyValueFlag.WindowsKeyValueFlag[source]
Represents a
NamedKeyValueFlagArgument
with a double dash in front of the switch name.Example:
--DDEBUG=TRUE
Inheritance
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.