mirror of https://github.com/borgbackup/borg.git
List help topics when invalid topic is requested
This commit is contained in:
parent
21601d5f53
commit
9e81a76172
|
@ -1951,7 +1951,12 @@ class Archiver:
|
||||||
else:
|
else:
|
||||||
commands[args.topic].print_help()
|
commands[args.topic].print_help()
|
||||||
else:
|
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
|
return self.exit_code
|
||||||
|
|
||||||
def do_subcommand_help(self, parser, args):
|
def do_subcommand_help(self, parser, args):
|
||||||
|
|
Loading…
Reference in New Issue