display available commands in ConsoleApplication's --help
This commit is contained in:
parent
ccf4303cc0
commit
40a118283f
2 changed files with 11 additions and 3 deletions
|
|
@ -104,6 +104,14 @@ class ConsoleApplication(BaseApplication):
|
|||
self.default_output_format = None
|
||||
|
||||
def _configure_parser(self, parser):
|
||||
parser.format_description = lambda x: parser.description
|
||||
|
||||
if parser.description is None:
|
||||
parser.description = ''
|
||||
parser.description += 'Available commands:\n'
|
||||
for f in self._command_help:
|
||||
parser.description += ' %s\n' % f
|
||||
|
||||
parser.add_option('-o', '--output-format', choices=formatters.keys(),
|
||||
help='output format %s (default: table)' % formatters.keys())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue