Skip to content

Commit 1164d54

Browse files
authored
Better explain how to document extended commands (#310)
1 parent 88b2792 commit 1164d54

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spin/cmds/util.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,14 @@ def extend_command(
127127
Command to extend.
128128
doc : str
129129
Replacement docstring.
130-
The wrapped function's docstring is also appended.
130+
The decorated function's docstring is also appended.
131+
This is done so that two modes of documenting are enabled:
132+
133+
1. Extend original command documentation.
134+
Do this by providing a docstring on the decorated function.
135+
2. Replace the original command's documentation.
136+
Do this either by setting ``doc`` to a docstring, or by
137+
setting ``doc=''`` and adding a docstring to the decorated function.
131138
remove_args : tuple of str
132139
List of arguments to remove from the parent command.
133140
These arguments can still be set explicitly by calling

0 commit comments

Comments
 (0)