only allow one parser

This commit is contained in:
Isaac 2023-04-27 21:57:50 -07:00
parent 412d18f218
commit 2e658cfa56
No known key found for this signature in database
GPG key ID: E69FB5A841448A48

View file

@ -65,6 +65,8 @@ def fish_completion():
'''
top_level_parser, subparsers = arguments.make_parsers()
all_subparsers = ' '.join(action for action in subparsers.choices.keys())
# Avert your eyes.
return '\n'.join(
(
@ -78,8 +80,8 @@ def fish_completion():
'end',
'__borgmatic_check_version &',
) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f'''
% (actionStr, shlex.quote(subparser.description))
'''complete -c borgmatic -a '%s' -d %s -f -n "not __fish_seen_subcommand_from %s"'''
% (actionStr, shlex.quote(subparser.description), all_subparsers)
for actionStr, subparser in subparsers.choices.items()
) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f'''