Skip to content

Commit e5ee97b

Browse files
committed
A command with help=None will now get that help from the docstring
which is good for overriding.
1 parent 1bd7fe7 commit e5ee97b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flask_script/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ def create_parser(self, prog, func_stack=(), parents=None):
177177

178178
for name, command in self._commands.items():
179179
usage = getattr(command, 'usage', None)
180-
help = getattr(command, 'help', command.__doc__)
181-
description = getattr(command, 'description', command.__doc__)
180+
help = getattr(command, 'help', None)
181+
if help is None: help = command.__doc__
182+
description = getattr(command, 'description', None)
183+
if description is None: description = command.__doc__
182184

183185
command_parser = command.create_parser(name, func_stack=func_stack)
184186

0 commit comments

Comments
 (0)