koapy.cli.extensions.verbose_option¶
Module Contents¶
Classes¶
Options are usually optional values on the command line and |
Functions¶
|
|
|
|
|
- class koapy.cli.extensions.verbose_option.VerboseOption(*decls, **attrs)[source]¶
Bases:
click.OptionOptions 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.
- Parameters:
show_default – Show the default value for this option in its help text. Values are not shown by default, unless
Context.show_defaultisTrue. If this value is a string, it shows that string in parentheses instead of the actual value. This is particularly useful for dynamic options. For single option boolean flags, the default remains hidden if its value isFalse.show_envvar – Controls if an environment variable should be shown on the help page. Normally, environment variables are not shown.
prompt – If set to
Trueor a non empty string then the user will be prompted for input. If set toTruethe prompt will be the option name capitalized.confirmation_prompt – Prompt a second time to confirm the value if it was prompted for. Can be set to a string instead of
Trueto customize the message.prompt_required – If set to
False, the user will be prompted for input only when the option was specified as a flag without a value.hide_input – If this is
Truethen the input on the prompt will be hidden from the user. This is useful for password input.is_flag – forces this option to act as a flag. The default is auto detection.
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.
multiple – if this is set to True then the argument is accepted multiple times and recorded. This is similar to
nargsin how it works but supports arbitrary number of arguments.count – this flag makes an option increment an integer.
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.
help – the help string.
hidden – hide this option from help outputs.
Changed in version 8.1.0: Help text indentation is cleaned here instead of only in the
@optiondecorator.Changed in version 8.1.0: The
show_defaultparameter overridesContext.show_default.Changed in version 8.1.0: The default of a single option boolean flag is not shown if the default value is
False.Changed in version 8.0.1:
typeis detected fromflag_valueif given.