.. _jgdv.cli.param_spec.extra: ========================= jgdv.cli.param_spec.extra ========================= .. py:module:: jgdv.cli.param_spec.extra Classes ------- .. autoapisummary:: jgdv.cli.param_spec.extra.ChoiceParam jgdv.cli.param_spec.extra.ConstrainedParam jgdv.cli.param_spec.extra.EntryParam jgdv.cli.param_spec.extra.ImplicitParam jgdv.cli.param_spec.extra.RepeatToggleParam jgdv.cli.param_spec.extra.RepeatableParam jgdv.cli.param_spec.extra.WildcardParam Module Contents =============== .. _jgdv.cli.param_spec.extra.ChoiceParam: .. py:class:: ChoiceParam(name, choices, **kwargs) Bases: :py:obj:`jgdv.cli.param_spec.core.LiteralParam` TODO A param that must be from a choice of literals eg: ChoiceParam([blah, bloo, blee]) : blah | bloo | blee .. py:method:: matches_head(val) -> 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 .. py:attribute:: _choices .. py:attribute:: desc :type: str :value: 'A Choice' .. _jgdv.cli.param_spec.extra.ConstrainedParam: .. py:class:: ConstrainedParam(**kwargs) Bases: :py:obj:`jgdv.cli.param_spec.param_spec.ParamSpec` TODO a type of parameter which is constrained in the values it can take, beyond just type. eg: {name:amount, constraints={min=0, max=10}} .. py:attribute:: constraints :type: list[Any] .. py:attribute:: desc :type: str :value: 'A Constrained Param' .. _jgdv.cli.param_spec.extra.EntryParam: .. py:class:: EntryParam(*args, **kwargs) Bases: :py:obj:`jgdv.cli.param_spec.core.LiteralParam` TODO a parameter that if it matches, returns list of more params to parse .. py:attribute:: desc :type: str :value: 'An expandable Param' .. _jgdv.cli.param_spec.extra.ImplicitParam: .. py:class:: ImplicitParam(**kwargs) Bases: :py:obj:`jgdv.cli.param_spec.param_spec.ParamSpec` A Parameter that is implicit, so doesn't give a help description unless forced to .. py:method:: help_str(*, force = False) -> .. py:attribute:: desc :type: str :value: 'An Implicit Parameter' .. _jgdv.cli.param_spec.extra.RepeatToggleParam: .. py:class:: RepeatToggleParam(*args, **kwargs) Bases: :py:obj:`jgdv.cli.param_spec.core.ToggleParam` TODO A repeatable toggle eg: -verbose -verbose -verbose .. py:attribute:: desc :type: str :value: 'A Repeat Toggle' .. _jgdv.cli.param_spec.extra.RepeatableParam: .. py:class:: RepeatableParam(*args, **kwargs) Bases: :py:obj:`jgdv.cli.param_spec.core.KeyParam` TODO a repeatable key param -key val -key val2 -key val3 .. py:method:: next_value(args) -> Get as many values as match eg: args[-test, 2, -test, 3, -test, 5, -nottest, 6] -> [2,3,5], [-nottest, 6] .. py:attribute:: desc :type: str :value: 'A Repeatable Key' .. py:attribute:: type_ :type: type .. _jgdv.cli.param_spec.extra.WildcardParam: .. py:class:: WildcardParam(*args, **kwargs) Bases: :py:obj:`jgdv.cli.param_spec.core.AssignParam` TODO a wildcard param that matches any --{key}={val} .. py:method:: matches_head(val) -> .. py:method:: next_value(args) -> get the value for a --key=val .. py:attribute:: desc :type: str :value: 'A Wildcard'