pyTooling.CLIAbstraction.BooleanFlag
Boolean flags are arguments with a name and different pattern for a positive (True
) and negative (False
) value.
See also
For simple flags.
→Flag
For flags with a value.
→ValuedFlag
For flags that have an optional value.
→NamedOptionalValuedFlag
Classes
BooleanFlag
: Class and base-class for all BooleanFlag classes, which represents a flag argument with different pattern for anShortBooleanFlag
: Represents aBooleanFlag
with a single dash.LongBooleanFlag
: Represents aBooleanFlag
with a double dash.WindowsBooleanFlag
: Represents aBooleanFlag
with a slash.
Classes
- class pyTooling.CLIAbstraction.BooleanFlag.BooleanFlag[source]
Class and base-class for all BooleanFlag classes, which represents a flag argument with different pattern for an enabled/positive (
True
) or disabled/negative (False
) state.When deriving a subclass from an abstract BooleanFlag class, the parameters
pattern
andfalsePattern
are expected.Example:
True:
with-checks
False:
without-checks
Inheritance
- __init__(value)[source]
Initializes a BooleanFlag instance.
- Parameters:
value (
bool
) – Initial value set for this argument instance.- Return type:
None
- AsArgument()[source]
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.BooleanFlag.ShortBooleanFlag[source]
Represents a
BooleanFlag
with a single dash.Example:
True:
-with-checks
False:
-without-checks
Inheritance
- 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:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __init__(value)
Initializes a BooleanFlag instance.
- Parameters:
value (
bool
) – Initial value set for this argument instance.- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.BooleanFlag.LongBooleanFlag[source]
Represents a
BooleanFlag
with a double dash.Example:
True:
--with-checks
False:
--without-checks
Inheritance
- 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:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __init__(value)
Initializes a BooleanFlag instance.
- Parameters:
value (
bool
) – Initial value set for this argument instance.- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.
- class pyTooling.CLIAbstraction.BooleanFlag.WindowsBooleanFlag[source]
Represents a
BooleanFlag
with a slash.Example:
True:
/with-checks
False:
/without-checks
Inheritance
- 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:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __init__(value)
Initializes a BooleanFlag instance.
- Parameters:
value (
bool
) – Initial value set for this argument instance.- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Argument formatted and enclosed in double quotes.