aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/git.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-10-20 15:49:22 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-10-20 15:49:22 +0200
commit4a05d56337cee44edad04fa11ad323ce794865ed (patch)
treeb387d295ae78e7f2fa2b584227fea2cb2ac6ac22 /share/completions/git.fish
parent73708061fc4141d7f32751788e6a90353e451620 (diff)
git: Disable submodule subcommand completion if one is already given
Diffstat (limited to 'share/completions/git.fish')
-rw-r--r--share/completions/git.fish17
1 files changed, 9 insertions, 8 deletions
diff --git a/share/completions/git.fish b/share/completions/git.fish
index 64771c49..7a4e2313 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -500,15 +500,16 @@ complete -f -c git -n '__fish_git_using_command format-patch' -l no-numbered -s
## git submodule
+set -l submodulecommands add status init update summary foreach sync
complete -f -c git -n '__fish_git_needs_command' -a submodule -d 'Initialize, update or inspect submodules'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'add' -d 'Add a submodule'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'status' -d 'Show submodule status'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'init' -d 'Initialize all submodules'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'update' -d 'Update all submodules'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'summary' -d 'Show commit summary'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'foreach' -d 'Run command on each submodule'
-complete -f -c git -n '__fish_git_using_command submodule' -a 'sync' -d 'Sync submodules\' URL with .gitmodules'
-complete -f -c git -n '__fish_git_using_command submodule' -s q -l quiet -d "Only print error messages"
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'add' -d 'Add a submodule'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'status' -d 'Show submodule status'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'init' -d 'Initialize all submodules'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'update' -d 'Update all submodules'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'summary' -d 'Show commit summary'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'foreach' -d 'Run command on each submodule'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -a 'sync' -d 'Sync submodules\' URL with .gitmodules'
+complete -f -c git -n "__fish_git_using_command submodule; and not __fish_seen_subcommand_from $submodulecommands" -s q -l quiet -d "Only print error messages"
complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l init -d "Initialize all submodules"
complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l checkout -d "Checkout the superproject's commit on a detached HEAD in the submodule"
complete -f -c git -n '__fish_git_using_command submodule; and __fish_seen_subcommand_from update' -l merge -d "Merge the superproject's commit into the current branch of the submodule"