You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/dispatch.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,19 +35,11 @@ the tool-level `help` command.
35
35
36
36
You may also specify groups; groups are containers of sub-commands, and may themselves contain sub-groups.
37
37
38
-
Groups serve two purposes:
39
-
40
-
* They divide the list of commands into sequences of related commands
41
-
42
-
* They may optionally define a command group name, which isolates the commands within the group; for example, the way the `docker` command has sub-commands such as `compose` and `volume`, each containing further sub-commands.
43
-
44
-
The group map is keyed on a command name, and its value defines the group; like the top-level map,
38
+
The group map is keyed on a group name, and its value defines the group; like the top-level map,
45
39
a group will contain keys for:namespaces, :title, :doc, and :groups (for more deeply nested groups).
46
40
47
41
The group's :title is used in the tool help summary.
48
-
49
-
Many of these options are optional; details in the [dispatch](dispatch.md) docs.
50
-
42
+
51
43

52
44
53
45
In the above example, `colors`, `completions`, `help`, `job-status-demo`, and `kill-port` are commands.
@@ -60,7 +52,8 @@ The :doc and :title group options may be omitted.
60
52
If :doc is omitted, then `dispatch` will search the group's namespaces, and use the first namespace docstring
61
53
it finds.
62
54
63
-
If :title is omitted, then the first line of the docstring, up to the first `.`, will be used as the title.
55
+
If :title is omitted, then the first sentence of the :doc key, up to (but not including)
56
+
the first `.`, will be used as the title.
64
57
65
58
## Callbacks
66
59
@@ -76,4 +69,4 @@ to invoke.
76
69
77
70
The :pre-invoke callback is invoked once a specific command function is identified.
78
71
The callback is invoked immediately before the command function is invoked; it is passed the
79
-
command map, and a seq of remaining arguments (that will be passed to the command function).
72
+
command map, and a seq of remaining arguments (that will then be passed to the command function).
0 commit comments