|
def | __init__ (self, param_decls=None, show_default=False, prompt=False, confirmation_prompt=False, hide_input=False, is_flag=None, flag_value=None, multiple=False, count=False, allow_from_autoenv=True, type=None, help=None, hidden=False, show_choices=True, show_envvar=False, **attrs) |
|
def | add_to_parser (self, parser, ctx) |
|
def | get_help_record (self, ctx) |
|
def | get_default (self, ctx) |
|
def | prompt_for_value (self, ctx) |
|
def | resolve_envvar_value (self, ctx) |
|
def | value_from_envvar (self, ctx) |
|
def | full_process_value (self, ctx, value) |
|
def | __init__ (self, param_decls=None, type=None, required=False, default=None, callback=None, nargs=None, metavar=None, expose_value=True, is_eager=False, envvar=None, autocompletion=None) |
|
def | __repr__ (self) |
|
def | human_readable_name (self) |
|
def | make_metavar (self) |
|
def | consume_value (self, ctx, opts) |
|
def | type_cast_value (self, ctx, value) |
|
def | process_value (self, ctx, value) |
|
def | value_is_missing (self, value) |
|
def | handle_parse_result (self, ctx, opts, args) |
|
def | get_usage_pieces (self, ctx) |
|
def | get_error_hint (self, ctx) |
|
Options are usually optional values on the command line and
have some extra features that arguments don't have.
All other parameters are passed onwards to the parameter constructor.
:param show_default: controls if the default value should be shown on the
help page. Normally, defaults are not shown. If this
value is a string, it shows the string instead of the
value. This is particularly useful for dynamic options.
:param show_envvar: controls if an environment variable should be shown on
the help page. Normally, environment variables
are not shown.
:param prompt: if set to `True` or a non empty string then the user will be
prompted for input. If set to `True` the prompt will be the
option name capitalized.
:param confirmation_prompt: if set then the value will need to be confirmed
if it was prompted for.
:param hide_input: if this is `True` then the input on the prompt will be
hidden from the user. This is useful for password
input.
:param is_flag: forces this option to act as a flag. The default is
auto detection.
:param flag_value: which value should be used for this flag if it's
enabled. This is set to a boolean automatically if
the option string contains a slash to mark two options.
:param multiple: if this is set to `True` then the argument is accepted
multiple times and recorded. This is similar to ``nargs``
in how it works but supports arbitrary number of
arguments.
:param count: this flag makes an option increment an integer.
:param allow_from_autoenv: if this is enabled then the value of this
parameter will be pulled from an environment
variable in case a prefix is defined on the
context.
:param help: the help string.
:param hidden: hide this option from help outputs.