From 4a05d56337cee44edad04fa11ad323ce794865ed Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 20 Oct 2015 15:49:22 +0200 Subject: git: Disable submodule subcommand completion if one is already given --- share/completions/git.fish | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'share') 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" -- cgit v1.2.3