All callbacks are called as follows:
func(option, opt_str, value, parser, *args, **kwargs)
where
option
opt_str
opt_str
will
be the full, canonical option string--e.g. if the user puts
--foo on the command-line as an abbreviation for
--foobar, then opt_str
will be --foobar.)
value
value
will be the type implied by the option's type. If type for this
option is None
(no argument expected), then value
will be
None
. If nargs
> 1, value
will be a tuple of values of
the appropriate type.
parser
parser.largs
parser.largs
, e.g. by adding more
arguments to it. (This list will become args
, the second
return value of parse_args().)
parser.rargs
opt_str
and
value
(if applicable) removed, and only the arguments
following them still there. Feel free to modify
parser.rargs
, e.g. by consuming more arguments.
parser.values
args
callback_args
option attribute.
kwargs
callback_kwargs
.
See About this document... for information on suggesting changes.