Skip to content
Myr

Added an example for multiple

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 18fff34 · Browse files · 1 file+22 added−0 removed
This commit

State

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

Diff stats

1 file+22 added−0 removed

  • other:+22 added−0 removed

1 file+22 added−0 removed

modified:docs/options.rst+22 added
50 unmodified lines
5152 $ python findme.py --pos 2.0 3.053 2.0 / 3.05455Multiple Options56----------------5758Similar to ``nargs`` there is also the case where sometimes you want to59support a parameter to be provided multiple times to and have all values60recorded and not just the last one. For instance ``git commit -m foo -m61bar`` would record two lines for the commit message. ``foo`` and ``bar``.62This can be accomplished with the ``multiple`` flag:6364Example::6566 @click.command()67 @click.option('--message', '-m', multiple=True)68 def commit(message):69 print('\n'.join(message))7071And on the command line::7273 $ python commit.py -m foo -m bar74 foo75 bar7677Boolean Flags78-------------7980Boolean flags are options that can be enabled or disabled. This can be
273 unmodified lines