use less completion lines
This commit is contained in:
parent
d265b6ed6f
commit
23f478ce74
1 changed files with 5 additions and 6 deletions
|
@ -80,25 +80,24 @@ def fish_completion():
|
||||||
'end',
|
'end',
|
||||||
'__borgmatic_check_version &',
|
'__borgmatic_check_version &',
|
||||||
) + (
|
) + (
|
||||||
'# subparser completions',
|
'\n# subparser completions',
|
||||||
) + tuple(
|
) + tuple(
|
||||||
'''complete -c borgmatic -a '%s' -d %s -f -n "not __fish_seen_subcommand_from %s"'''
|
'''complete -c borgmatic -a '%s' -d %s -f -n "not __fish_seen_subcommand_from %s"'''
|
||||||
% (actionStr, shlex.quote(subparser.description), all_subparsers)
|
% (actionStr, shlex.quote(subparser.description), all_subparsers)
|
||||||
for actionStr, subparser in subparsers.choices.items()
|
for actionStr, subparser in subparsers.choices.items()
|
||||||
) + (
|
) + (
|
||||||
'# global flags',
|
'\n# global flags',
|
||||||
) + 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
|
||||||
) + (
|
) + (
|
||||||
'# subparser flags',
|
'\n# subparser flags',
|
||||||
) + tuple(
|
) + tuple(
|
||||||
'''complete -c borgmatic -a '%s' -d %s -f -n "__fish_seen_subcommand_from %s"'''
|
'''complete -c borgmatic -a '%s' -d %s -n "__fish_seen_subcommand_from %s" -f'''
|
||||||
% (option, shlex.quote(action.help), actionStr)
|
% (' '.join(action.option_strings), shlex.quote(action.help), actionStr)
|
||||||
for actionStr, subparser in subparsers.choices.items()
|
for actionStr, subparser in subparsers.choices.items()
|
||||||
for action in subparser._actions
|
for action in subparser._actions
|
||||||
for option in action.option_strings
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue