|
◆ option()
fhs.option |
( |
|
name, |
|
|
|
help, |
|
|
|
short = None , |
|
|
|
multiple = False , |
|
|
|
optional = False , |
|
|
|
default = None , |
|
|
|
noarg = None , |
|
|
|
argtype = None , |
|
|
|
module = None , |
|
|
|
options = None , |
|
|
|
option_order = None |
|
) |
| |
Register commandline argument.
- Parameters
-
name | Name of the option argument. Should not include the "--" prefix. |
help | Help text when displaying the –help output. |
multiple | If True, this option may be specified multiple times and the value will be a list of the arguments. |
optional | If True, this option's argument may be omitted. |
default | Default value of this argument. This is used if the option is not passed and multiple is False. |
noarg | Default value when option is passed without argument. This is ignored unless optional is True. |
argtype | Type of the argument. If this is None and a default is given, type(default) is used. If default is None, str is used. If argtype is bool, no argument is allowed and default, noarg default to False, True. This type is called to construct the value. It can also be used as a callback. |
Definition at line 448 of file fhs.py.
|