Skip to content

Commit

Permalink
Add more detail to command and group docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowlando13 committed Jan 15, 2025
1 parent b72256a commit a31c463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs/commands-and-groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ This behavior is observable with the ``--help`` option. Suppose we have a group

Arbitrary Nesting
------------------
Commands are attached to a 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 nest under multiple groups, all the above groups must added.
: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.

.. click:example::
Expand All @@ -196,7 +195,7 @@ To invoke a command nest under multiple groups, all the above groups must added.

Lazily Attaching Commands
--------------------------
Most examples so far have attached the the commands and group immediately, but commands may be registered later. This could be used to split command into multiple Python modules.
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.

.. click:example::
Expand All @@ -215,6 +214,11 @@ Most examples so far have attached the the commands and group immediately, but c
cli.add_command(initdb)
cli.add_command(dropdb)

.. click:run::
invoke(cli, args=['initdb'])
invoke(cli, args=['dropdb'])

Context Object
-------------------
The :class:`Context` object ...
The :class:`Context` object is how commands and groups communicate.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ usage patterns.
options
option-decorators
arguments
commands
commands-and-groups
commands
documentation
prompts
complex
Expand Down

0 comments on commit a31c463

Please sign in to comment.