show sub options

This commit is contained in:
Isaac 2023-04-27 21:31:53 -07:00
parent 8060586d8b
commit 412d18f218
No known key found for this signature in database
GPG key ID: E69FB5A841448A48

View file

@ -79,12 +79,18 @@ def fish_completion():
'__borgmatic_check_version &', '__borgmatic_check_version &',
) + tuple( ) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f''' '''complete -c borgmatic -a '%s' -d %s -f'''
% (action, shlex.quote(subparser.description)) % (actionStr, shlex.quote(subparser.description))
for action, subparser in subparsers.choices.items() for actionStr, subparser in subparsers.choices.items()
) + tuple( ) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f''' '''complete -c borgmatic -a '%s' -d %s -f'''
% (option, shlex.quote(action.help)) % (option, shlex.quote(action.help))
for action in top_level_parser._actions for action in top_level_parser._actions
for option in action.option_strings for option in action.option_strings
) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f -n "__fish_seen_subcommand_from %s"'''
% (option, shlex.quote(action.help), actionStr)
for actionStr, subparser in subparsers.choices.items()
for action in subparser._actions
for option in action.option_strings
) )
) )