Skip to content
Myr

Fix typos in second half of options docs.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Edward G · committed by Edward G · parent 680e888 · Browse files · 3 files+9 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+9 added−15 removed

  • other:+9 added−15 removed

3 files+9 added−15 removed

modified:docs/option-decorators.rst+1 added-1 removed
79 unmodified lines
80 click.echo('Dropped all tables!')8182Version Option83----------------84:func:`version_option` adds a --version option which immediately prints the version number and exits the program.84:func:`version_option` adds a ``--version`` option which immediately prints the version number and exits the program.
modified:docs/options.rst+5 added-13 removed
281 unmodified lines
282 invoke(info, args=['--help'])283284Flag Value285---------------286To have an flag pass a value to the underlying function set ``flag_value`` to the value desired. This automatically sets ``is_flag=True``. To set a default flag, set ``default=True``. Setting flag values can be used to create patterns like this:286To have an flag pass a value to the underlying function set ``flag_value``. This automatically sets ``is_flag=True``. To set a default flag, set ``default=True``. Setting flag values can be used to create patterns like this:287288.. click:example::289290 import sys
40 unmodified lines
331 invoke(greet, env={'ALT_USERNAME': 'Bill', 'USERNAME': 'john'})332333Auto Envvar Prefix334--------------------335336---move to context section337338335Automatically built environment variables are supported for options only. To enable this feature, the ``auto_envvar_prefix`` parameter needs to be passed to the script that is invoked. Each command and parameter is then added as an uppercase underscore-separated variable. If you have a subcommand336called ``run`` taking an option called ``reload`` and the prefix is ``WEB``, then the variable is ``WEB_RUN_RELOAD``.337338Example usage:
54 unmodified lines
393394The default implementation for all types is to split on whitespace. The395exceptions to this rule are the :class:`File` and :class:`Path` types396which both split according to the operating system's path splitting rules.401On Unix systems like Linux and OS X, the splitting happens for those on402every colon (``:``), and for Windows, on every semicolon (``;``).397On Unix systems like Linux and OS X, the splitting happens on398every colon (``:``), and for Windows, splitting on every semicolon (``;``).399404Example usage:405400.. click:example::401402 @click.command()403 @click.option('paths', '--path', envvar='PATHS', multiple=True,
4 unmodified lines
408409 if __name__ == '__main__':410 perform()411418And from the command line:419412.. click:run::413414 import os415 invoke(perform, env={"PATHS": f"./foo/bar{os.path.pathsep}./test"})
27 unmodified lines
443providing only the option's flag without a value will either show a444prompt or use its ``flag_value``.445446Setting ``is_flag=False, flag_value=value`` tells Click that the option455can still be passed a value, but if only the flag is given the456``flag_value`` is used.447can still be passed a value, but only if the flag is given the448``flag_value``.449450.. click:example::451452 @click.command()
9 unmodified lines
modified:docs/prompts.rst+3 added-1 removed
19 unmodified lines
20Option Prompts21--------------2223Option prompts are integrated into the option interface. Internally, it24automatically calls either :func:`prompt` or :func:`confirm` as necessary. In some cases, you want parameters that can be provided from the command line,24automatically calls either :func:`prompt` or :func:`confirm` as necessary.2526In some cases, you want parameters that can be provided from the command line,27but if not provided, ask for user input instead. This can be implemented with28Click by defining a prompt string.2930Example:
132 unmodified lines