Skip to content
Myr

Added examples of default to boolean flags section (#1697)

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

I've found myself a few times double checking what the default option is when a boolean flag is use i.e. does `default=False` refer to the first flag or the second flag. Thought adding an example of the calls without any flags to the docs would make this a bit clearer.

authored by lrjball · committed by GitHub · parent 801a29f · Browse files · 1 file+2 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+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:docs/options.rst+2 added
251 unmodified lines
252.. click:run::253254 invoke(info, args=['--shout'])255 invoke(info, args=['--no-shout'])256 invoke(info)257258If you really don't want an off-switch, you can just define one and259manually inform Click that something is a flag:260
13 unmodified lines
274275.. click:run::276277 invoke(info, args=['--shout'])278 invoke(info)279280Note that if a slash is contained in your option already (for instance, if281you use Windows-style parameters where ``/`` is the prefix character), you282can alternatively split the parameters through ``;`` instead:
618 unmodified lines