Docs: fixed some spelling and punctuation mistakes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Julen Ruiz Aizpuru · committed by Julen Ruiz Aizpuru · parent da717da · Browse files · 4 files·+11 added−11 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+11 added−11 removed
- other:+11 added−11 removed
Provenance
- Commit
d30014b- Tree
dcad6f7- Author
Julen Ruiz Aizpuru <julenx@gmail.com>- Committer
Julen Ruiz Aizpuru <julenx@gmail.com>- Parent
da717da
4 files changed+11 added−11 removed
modified:docs/arguments.rst+2 added-2 removed
33 unmodified lines34 unlimited) number of arguments is accepted. This can be controlled with35 the ``nargs`` parameter. If it's set to ``-1`` then an unlimited number36 of arguments is accepted.37 38-The value is then passed as tuple. Note that only one argument really can39-be set to ``nargs=-1`` and right now only the last.38+The value is then passed as a tuple. Note that only one argument really39+can be set to ``nargs=-1`` and right now only the last.40 41 Example::42 43 @click.command()71 unmodified linesmodified:docs/complex.rst+2 added-2 removed
39 unmodified lines40 Because the parent data is however available it's possible to navigate to41 it if needed.42 43 Most of the time you don't see the context object, but when writing more44-complex applications it comes in handy. This brings is to the next point44+complex applications it comes in handy. This brings us to the next point.45 46 Calling Convention47 ``````````````````48 18 unmodified lines67 68 The Root Command69 ````````````````70 71-At the toplevel we need a group that can hold all our commands. In this71+At the top level we need a group that can hold all our commands. In this72 case we use the basic :func:`click.group` which allows us to register73 other click commands below it.74 75 For this command we also want to accept some parameters that configure the95 unmodified linesmodified:docs/options.rst+6 added-6 removed
28 unmodified lines29 30 In this case the option is of type :data:`INT` because the default value31 is an integer.32 33-The name of the parameter is the longest33+The name of the parameter is the longest.34 35 Multi Value Options36 -------------------37 38 Sometimes you have options that take more than one argument. For options39 only a fixed number of arguments is supported. This can be configured by40-the ``nargs`` parameter. The values are then stored as tuple:40+the ``nargs`` parameter. The values are then stored as a tuple.41 42 Example::43 44 76 unmodified lines121 122 Feature Switches123 ----------------124 125-In addition to boolean flag there are also feature switches. These are125+In addition to boolean flags there are also feature switches. These are126 implemented by setting multiple options to the same parameter name and by127 defining a flag value. To set a default flag assign a value of `True` to128 the flag that should be the default.129 23 unmodified lines153 ---------154 155 Sometimes you want parameters that can either be provided from the command156 line or if not, you want to ask for user input. This can be implemented157-with click by defining a prompt string:157+with click by defining a prompt string.158 159 Example::160 161 import os58 unmodified lines220 ---------------------------221 222 Sometimes you want a parameter to completely change the execution flow.223 This for instance is the case when you want to have a ``--version``224-parameter that prints out the version and then exists the application.224+parameter that prints out the version and then exits the application.225 226 In such cases you need two concepts: eager parameters and a callback. An227 eager parameter is a parameter that is handled before others and a228 callback is what executes after the parameter is handled. The eagerness80 unmodified lines309 This is supported by click in two ways. One is to automatically build310 environment variables which is supported for options only. To enable this311 feature the ``auto_envvar_prefix`` parameter needs to be passed to the312 script that is invoked. Each command and parameter is then added as313-underscore separated variable in uppercase. So if you have a subcommand313+underscore-separated variable in uppercase. So if you have a subcommand314 called ``foo`` taking an option called ``bar`` and the prefix is315 ``MY_TOOL`` then the variable is ``MY_TOOL_FOO_BAR``.316 317 Example usage::36 unmodified linesmodified:docs/setuptools.rst+1 added-1 removed
52 unmodified lines53 )54 55 The magic is in the ``entry_points`` parameter. Below ``console_scripts``56 each line identifies one console script. The first part before the equals57-sign (``=``) is the name of the script that should be generate, the second57+sign (``=``) is the name of the script that should be generated, the second58 part is the import path followed by a colon (``:``) with the click59 command.60 61 That's it.15 unmodified lines