From 725c720d3de37989a6733699f1ad7ca858770df3 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 27 Sep 2022 14:02:32 -0500 Subject: [PATCH] Completions: add `git for-each-ref` subcommand and its arguments --- share/completions/git.fish | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/share/completions/git.fish b/share/completions/git.fish index eb96a4d67..424f6c557 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -2285,6 +2285,25 @@ complete -f -c git -n '__fish_git_using_command config' -l includes -d 'Respect complete -f -c git -n '__fish_git_using_command config' -l show-origin -d 'Show origin of configuration' complete -f -c git -n '__fish_git_using_command config' -n '__fish_seen_argument get' -l default -d 'Use default value when missing entry' +### for-each-ref +complete -f -c git -n __fish_git_needs_command -a "for-each-ref" -d "Format and output info on each ref" +complete -f -c git -n '__fish_git_using_command for-each-ref' -l count -d "Limit to n results" +# Any one of --shell, --perl, --python, or --tcl +set -l for_each_ref_interpreters shell perl python tcl +for intr in $for_each_ref_interpreters + complete -f -c git -n '__fish_git_using_command for-each-ref' \ + -n "not __fish_seen_argument_from --$for_each_ref_interpreters" \ + -l $intr -d "%(fieldname) placeholders are $intr scripts" +end +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l format -d "Format string with %(fieldname) placeholders" +complete -f -c git -n '__fish_git_using_command for-each-ref' -f -l color -d "When to color" -a "always never auto" +complete -f -c git -n '__fish_git_using_command for-each-ref' -l points-at -d "Only list refs pointing at object" -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l merged -d "Only list refs reachable from specified commit" -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l no-merged -d "Only list refs not reachable from specified commit" -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l contains -d "Only list refs containing the specified commit" -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l no-contains -d "Only list refs not containing the specified commit" -ka '(__fish_git_commits)' +complete -f -c git -n '__fish_git_using_command for-each-ref' -x -l ignore-case -d "Sorting and filtering refs are case insensitive" + ## Custom commands (git-* commands installed in the PATH) complete -c git -n __fish_git_needs_command -a '(__fish_git_custom_commands)' -d 'Custom command'