Cleanup typos.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Edward G · committed by Edward G · parent a31c463 · Browse files · 1 file·+8 added−14 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+8 added−14 removed
- other:+8 added−14 removed
Provenance
- Commit
9b640af- Tree
0598177- Author
Edward G <edward.g2013@gmail.com>- Committer
Edward G <edward.g2013@gmail.com>- Parent
a31c463
1 file changed+8 added−14 removed
modified:docs/commands-and-groups.rst+8 added-14 removed
51 unmodified lines52 invoke(hello, args=['--count', '2',])53 54 Basic Group Example55 ---------------------56-A group wraps command(s). After being wrapped, the commands are nested under that group. You can see that on the help pages and in the execution. By default, invoking the group with no command shows the help page.56+A group wraps one or more commands. After being wrapped, the commands are nested under that group. You can see that on the help pages and in the execution. By default, invoking the group with no command shows the help page.57 58 .. click:example::59 @click.group()60 def greeting():24 unmodified lines85 -----------------86 To have a name other than the decorated function name as the group name, pass it in as the first positional argument.87 88 .. click:example::89- @click.group('greet_someone')89+ @click.group('greet-someone')90 def greeting():91 click.echo('Starting greeting ...')92 93 @greeting.command('say-hello')8 unmodified lines102 103 Group Invocation Without Command104 --------------------------------105 106-By default, a group is not invoked unless a subcommand is passed. In fact, not107-providing a command automatically passes ``--help`` by default. This behavior108-can be changed by passing ``invoke_without_command=True`` to a group. In that109-case, the callback is always invoked instead of showing the help page. The110-context object also includes information about whether or not the invocation111-would go to a subcommand.106+By default, if a group is passed without a command, the group is not invoked and a command automatically passes ``--help``. To change this, pass ``invoke_without_command=True`` to the group. The context object also includes information about whether or not the group invocation would go to a command nested under it.107 108 .. click:example::109 110 @click.group(invoke_without_command=True)16 unmodified lines127 128 129 Group Separation130 --------------------------136-Within a group, command :ref:`parameters` attached to a command belong only to that command.131+Command :ref:`parameters` attached to a command belong only to that command.132 133 .. click:example::134 @click.group()135 def greeting():22 unmodified lines158 This behavior is observable with the ``--help`` option. Suppose we have a group called ``tool`` containing a command called ``sub``.159 160 - ``tool --help`` returns the help for the whole program (listing subcommands).161 - ``tool sub --help`` returns the help for the ``sub`` subcommand.167-- But ``tool.py --help sub`` treats ``--help`` as an argument for the main program. Click then invokes the callback for ``--help``, which prints the help and aborts the program before click can process the subcommand.162+- But ``tool --help sub`` treats ``--help`` as an argument for the main program. Click then invokes the callback for ``--help``, which prints the help and aborts the program before click can process the subcommand.163 164 Arbitrary Nesting165 ------------------171-:class:`Commands <Command>` are attached to a :class:`Group`. Multiple groups can be attached to another group. Groups containing multiple groups can be attached to a group, and so on. To invoke a command nested under multiple groups, all the groups under which it is nested must added.166+:class:`Commands <Command>` are attached to a :class:`Group`. Multiple groups can be attached to another group. Groups containing multiple groups can be attached to a group, and so on. To invoke a command nested under multiple groups, all the groups under which it is nested must be invoked.167 168 .. click:example::169 170 @click.group()18 unmodified lines189 invoke(cli, args=['session', 'initdb'])190 191 Lazily Attaching Commands192 --------------------------198-Most examples so far have attached the commands and to a group immediately, but commands may be registered later. This could be used to split commands into multiple Python modules. Regardless of how they are attached, the commands are invoked identically.193+Most examples so far have attached the commands to a group immediately, but commands may be registered later. This could be used to split commands into multiple Python modules. Regardless of how they are attached, the commands are invoked identically.194 195 .. click:example::196 197 @click.group()198 def cli():199 pass200 206- @click.command()201+ @cli.command()202 def initdb():203 click.echo('Initialized the database')204 205 @click.command()206 def dropdb():207 click.echo('Dropped the database')208 214- cli.add_command(initdb)209 cli.add_command(dropdb)210 211 .. click:run::212 6 unmodified lines