argclz.dispatch.core.DispatchCommand#
- class argclz.dispatch.core.DispatchCommand[source]#
Bases:
NamedTupleThe information of
dispatch()function. Usedispatch()instead. Do not create this class directly.- __init__()#
Methods Summary
Attributes Summary
secondary command
primary command
all acceptable commands
document of the command.
target function
dispatch group
Is it hidden?
order of this command shown in the help document
usage line of this command
parameter validators
Details
Is it hidden?
- __call__(zelf, *args, **kwargs)[source]#
invoke commands.
parameter pre-processing
If any argument in args is a str that matches ‘name=value’ patterns, it will be parsed into a keyword argument. It allows use key=value pattern in commandline without knowing the position of the parameter.
parameter post-processing
If any argument has a validator (by
validator_for()), the argument will be casted to desired type (if it is a str) and be validated. An ValueError will be raised when validation fail.