basic working version

This commit is contained in:
Isaac 2023-04-27 19:44:11 -07:00
parent 28b152aedd
commit 5678f3a96e
No known key found for this signature in database
GPG key ID: E69FB5A841448A48

View file

@ -1,4 +1,5 @@
from borgmatic.commands import arguments
import shlex
def upgrade_message(language: str, upgrade_command: str, completion_file: str):
return f'''
@ -76,5 +77,12 @@ def fish_completion():
' echo "{}"'.format(upgrade_message('fish', 'borgmatic --fish-completion | sudo tee (status current-filename)', '(status current-filename)')),
' end',
'end',
# 'function __borgmatic_complete',
))
) + tuple(
'''complete -c borgmatic -n '__borgmatic_check_version' -a '%s' -d %s -f'''
% (action, shlex.quote(subparser.description))
for action, subparser in subparsers.choices.items()
) + (
'complete -c borgmatic -a "%s" -d "borgmatic actions" -f' % actions,
'complete -c borgmatic -a "%s" -d "borgmatic global flags" -f' % global_flags,
)
)