We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fee6abe commit 505f12fCopy full SHA for 505f12f
1 file changed
spin/cmds/util.py
@@ -170,9 +170,15 @@ def parent_cmd(*user_args, **user_kwargs):
170
my_cmd.callback = click.pass_context(callback_with_parent_callback)
171
my_cmd.callback._parent = user_func # type: ignore[attr-defined]
172
173
+ # If doc is present then combine it with user_func.__doc__
174
+ # Otherwise override it with user_func.__doc__
175
+ # if it is not empty.
176
if doc is not None:
- my_cmd.help = doc
- my_cmd.help = (my_cmd.help or "") + "\n\n" + (user_func.__doc__ or "")
177
+ my_cmd.help = doc + "\n\n" + (user_func.__doc__ or "")
178
+ else:
179
+ my_cmd.help = (my_cmd.help or "")
180
+ if user_func.__doc__ is not None:
181
+ my_cmd.help = user_func.__doc__
182
my_cmd.help = my_cmd.help.strip()
183
184
my_cmd.name = user_func.__name__.replace("_", "-")
0 commit comments