clarify multiple options
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Chris Sullins · committed by David Lord · parent f546f06 · Browse files · 4 files·+10 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+10 added−7 removed
- other:+10 added−7 removed
Provenance
- Commit
2efe22f- Tree
9b366e6- Author
Chris Sullins <chris.sullins@oracle.com>- Committer
David Lord <davidism@gmail.com>- Parent
f546f06
4 files changed+10 added−7 removed
modified:docs/bashcomplete.rst+4 added-4 removed
16 unmodified lines17 18 What it Completes19 -----------------20 21-Generally, the Bash completion support will complete subcommands, options22-and any option or argument values where the type is click.Choice.23-Subcommands and choices are always listed whereas options only if at24-least a dash has been provided. Example::21+Generally, the Bash completion support will complete subcommands,22+options, and any option or argument values where the type is23+:class:`click.Choice`. Subcommands and choices are always listed whereas24+options are only listed if at least a dash has been provided. ::25 26 $ repo <TAB><TAB>27 clone commit copy delete setuser28 $ repo clone -<TAB><TAB>103 unmodified linesmodified:docs/options.rst+2 added
143 unmodified lines144 @click.option('--item', nargs=2, type=click.Tuple([str, int]))145 def putitem(item):146 click.echo('name=%s id=%d' % item)147 148+.. _multiple-options:149+150 Multiple Options151 ----------------152 153 Similarly to ``nargs``, there is also the case of wanting to support a675 unmodified linesmodified:docs/parameters.rst+2 added-1 removed
26 unmodified lines27 might be too specific to be automatically documented)28 29 On the other hand arguments, unlike options, can accept an arbitrary number30 of arguments. Options can strictly ever only accept a fixed number of31-arguments (defaults to 1).31+arguments (defaults to 1), or they may be specified multiple times using32+:ref:`multiple-options`.33 34 Parameter Types35 ---------------36 114 unmodified linesmodified:docs/utils.rst+2 added-2 removed
31 unmodified lines32 33 Last but not least :func:`echo` uses click's intelligent internal output34 streams to stdout and stderr which support unicode output on the Windows35 console. This means for as long as you are using `click.echo` you can36-output unicode character (there are some limitations on the default font36+output unicode characters (there are some limitations on the default font37 with regards to which characters can be displayed). This functionality is38 new in Click 6.0.39 40 .. versionadded:: 6.0169 unmodified lines210 Click supports launching editors automatically through :func:`edit`. This211 is very useful for asking users for multi-line input. It will212 automatically open the user's defined editor or fall back to a sensible213 default. If the user closes the editor without saving, the return value214-will be `None` otherwise the entered text.214+will be ``None``, otherwise the entered text.215 216 Example usage::217 218 import click202 unmodified lines