openpectus.lang.exec.argument_specification
Classes
Functions
|
Decorator to decorate a command class with an argument validation spec |
Decorator for command class. Specifies that the command takes no arguments. |
|
|
Decorator for command class. Specifies that the command arguments string must match |
Module Contents
- class openpectus.lang.exec.argument_specification.ArgSpec(regex)
-
- regex
- validate(argument)
- Parameters:
argument (str)
- Return type:
bool
- validate_w_groups(argument)
- Parameters:
argument (str)
- Return type:
dict[str, str] | None
- static Regex(regex)
Speficy that the argument must match the given regex
- Parameters:
regex (str)
- Return type:
- __str__()
- openpectus.lang.exec.argument_specification.command_argument(validation_spec)
Decorator to decorate a command class with an argument validation spec
- Parameters:
validation_spec (ArgSpec)
- openpectus.lang.exec.argument_specification.command_argument_none()
Decorator for command class. Specifies that the command takes no arguments.
- openpectus.lang.exec.argument_specification.command_argument_regex(regex)
Decorator for command class. Specifies that the command arguments string must match the given regular expression.
Additionally, if the regex uses capture groups, the group values for a given argument can be extracted in a generic way.
- Parameters:
regex (str)