mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 15:12:00 +00:00
List help topics when invalid topic is requested
(cherry picked from commit 9e81a76172
)
This commit is contained in:
parent
96675e06c8
commit
00865ae89e
1 changed files with 6 additions and 1 deletions
|
@ -2205,7 +2205,12 @@ def do_help(self, parser, commands, args):
|
|||
else:
|
||||
commands[args.topic].print_help()
|
||||
else:
|
||||
parser.error('No help available on %s' % (args.topic,))
|
||||
msg_lines = []
|
||||
msg_lines += ['No help available on %s.' % args.topic]
|
||||
msg_lines += ['Try one of the following:']
|
||||
msg_lines += [' Commands: %s' % ', '.join(sorted(commands.keys()))]
|
||||
msg_lines += [' Topics: %s' % ', '.join(sorted(self.helptext.keys()))]
|
||||
parser.error('\n'.join(msg_lines))
|
||||
return self.exit_code
|
||||
|
||||
def do_subcommand_help(self, parser, args):
|
||||
|
|
Loading…
Reference in a new issue