jgdv.cli.param_spec.extra
Classes
TODO A param that must be from a choice of literals |
|
TODO a type of parameter which is constrained in the values it can take, beyond just type. |
|
TODO a parameter that if it matches, |
|
A Parameter that is implicit, so doesn't give a help description unless |
|
TODO A repeatable toggle |
|
TODO a repeatable key param |
|
TODO a wildcard param that matches any --{key}={val} |
Module Contents
- class jgdv.cli.param_spec.extra.ChoiceParam(name, choices, **kwargs)[source]
Bases:
jgdv.cli.param_spec.core.LiteralParamTODO A param that must be from a choice of literals eg: ChoiceParam([blah, bloo, blee]) : blah | bloo | blee
- matches_head(val) <Unknown>[source]
test to see if a cli argument matches this param
Matchs {self.prefix}{self.name} if not an assignment Matches {self.prefix}{self.name}{separator} if an assignment
- Return type:
- _choices
- class jgdv.cli.param_spec.extra.ConstrainedParam(**kwargs)[source]
Bases:
jgdv.cli.param_spec.param_spec.ParamSpecTODO a type of parameter which is constrained in the values it can take, beyond just type.
eg: {name:amount, constraints={min=0, max=10}}
- Parameters:
kwargs (Any)
- class jgdv.cli.param_spec.extra.EntryParam(*args, **kwargs)[source]
Bases:
jgdv.cli.param_spec.core.LiteralParamTODO a parameter that if it matches, returns list of more params to parse
- Parameters:
args (Any)
kwargs (Any)
- class jgdv.cli.param_spec.extra.ImplicitParam(**kwargs)[source]
Bases:
jgdv.cli.param_spec.param_spec.ParamSpecA Parameter that is implicit, so doesn’t give a help description unless forced to
- Parameters:
kwargs (Any)
- class jgdv.cli.param_spec.extra.RepeatToggleParam(*args, **kwargs)[source]
Bases:
jgdv.cli.param_spec.core.ToggleParamTODO A repeatable toggle eg: -verbose -verbose -verbose
- Parameters:
args (Any)
kwargs (Any)
- class jgdv.cli.param_spec.extra.RepeatableParam(*args, **kwargs)[source]
Bases:
jgdv.cli.param_spec.core.KeyParamTODO a repeatable key param -key val -key val2 -key val3
- class jgdv.cli.param_spec.extra.WildcardParam(*args, **kwargs)[source]
Bases:
jgdv.cli.param_spec.core.AssignParamTODO a wildcard param that matches any –{key}={val}
- Parameters:
args (Any)
kwargs (Any)