File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,15 @@ def parent_cmd(*user_args, **user_kwargs):
170
170
my_cmd .callback = click .pass_context (callback_with_parent_callback )
171
171
my_cmd .callback ._parent = user_func # type: ignore[attr-defined]
172
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.
173
176
if doc is not None :
174
- my_cmd .help = doc
175
- 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__
176
182
my_cmd .help = my_cmd .help .strip ()
177
183
178
184
my_cmd .name = user_func .__name__ .replace ("_" , "-" )
You can’t perform that action at this time.
0 commit comments