Merge pull request #10 from epequeno/spellcheck
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Spellcheck
authored by Armin Ronacher · committed by Armin Ronacher · parents 3eba021, 1d47e20 · Browse files · 2 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
6241146- Tree
63ae47a- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
3eba021- Parent 2
1d47e20
2 files changed+9 added−9 removed
modified:docs/options.rst+4 added-4 removed
3 unmodified lines4 .. currentmodule:: click5 6 Adding options to commands can be accomplished by the :func:`option`7 decorator. Since options can come in various different versions there8-have a ton of parameters to configure their behavior.8+are a ton of parameters to configure their behavior.9 10 Basic Value Options11 -------------------12 88 unmodified lines101 ----------------102 103 In addition to boolean flag there are also feature switches. These are104 implemented by setting multiple options to the same parameter name and by105-defining a flag value. To select a default the default flag can be set to106-`True` on the one that should be the default.105+defining a flag value. To set a default flag assign a value of `True` to106+the flag that should be the default.107 108 Example::109 110 import os167 unmodified lines278 ---------------------------------279 280 A very useful feature of click is the ability to accept parameters from281 environment variables in addition to regular parameters. This allows282-tools to be much easier automated. For instance you might want to pass282+tools to be automated much easier. For instance you might want to pass283 the config file as ``--config`` parameter but also support exporting a284 ``TOOL_CONFIG=hello.cfg`` key / value pair for a nicer development285 experience.286 45 unmodified linesmodified:docs/parameters.rst+5 added-5 removed
7 unmodified lines8 when to use which so here is a quick overview of the differences. As the9 name indicates an option is optional. While arguments can be optional10 within reason they are much more restricted in how they can be optional.11 12-To help you pick when to use what the recommendation is to use arguments13-exclusively for things like going to subcommands or input filenames /14-URLs and have everything else be an option instead.12+To help you decide between options and arguments, the recommendation is13+to use arguments exclusively for things like going to subcommands or input 14+filenames / URLs and have everything else be an option instead.15 16 Differences17 -----------18 43 unmodified lines62 Parameter Names63 ---------------64 65 Parameters (both options and arguments) accept a number of positional66-arguments which are the parameter declarations. Each string string with a66+arguments which are the parameter declarations. Each string with a67 single dash is added as short argument, each string starting with a double68 dash as long one. If a string is added without any dashes it's the69 internal parameter name which is also used as variable name.70 71-If a parameter does not have a name without dashes added one is generated71+If a parameter is not given a name without dashes a name is generated72 automatically by taking the longest argument and converting all dashes to73 underscores. So for an option with ``('-f', '--foo-bar')`` the parameter74 name is `foo_bar`. For an option with ``('-x',)`` the parameter is `x`.75 For an option with ``('-f', '--filename', 'dest')`` the parameter is33 unmodified lines