add comments in generated files

This commit is contained in:
Isaac 2023-04-28 11:57:16 -07:00
parent 2e658cfa56
commit d265b6ed6f
No known key found for this signature in database
GPG key ID: E69FB5A841448A48

View file

@ -79,15 +79,21 @@ def fish_completion():
' end', ' end',
'end', 'end',
'__borgmatic_check_version &', '__borgmatic_check_version &',
) + (
'# 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',
) + 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',
) + tuple( ) + tuple(
'''complete -c borgmatic -a '%s' -d %s -f -n "__fish_seen_subcommand_from %s"''' '''complete -c borgmatic -a '%s' -d %s -f -n "__fish_seen_subcommand_from %s"'''
% (option, shlex.quote(action.help), actionStr) % (option, shlex.quote(action.help), actionStr)