From 32a585a52b20687a1a16c45142da2261d28b7a27 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 4 Jun 2016 12:27:06 +0200 Subject: git completions: Only take general options before command --- share/completions/git.fish | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 09359270..4e9c9e2d 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -206,24 +206,24 @@ end # general options complete -f -c git -l help -d 'Display the manual of a git command' -complete -f -c git -l version -d 'Display version' -complete -x -c git -s C -a '(__fish_complete_directories)' -d 'Run as if git was started in this directory' -complete -x -c git -s c -a '(command git config -l | string replace = \t)' -d 'Set a configuration option' -complete -x -c git -l exec-path -a '(__fish_git_complete_directories)' -d 'Get or set the path to the git programs' -complete -f -c git -l html-path -d 'Print the path to the html documentation' -complete -f -c git -l man-path -d 'Print the path to the man documentation' -complete -f -c git -l info-path -d 'Print the path to the info documentation' -complete -f -c git -s p -l paginate -d 'Pipe output into a pager' -complete -f -c git -l no-pager -d 'Do not pipe output into a pager' -complete -f -c git -l git-dir -d 'Set the path to the repository' -complete -f -c git -l work-tree -d 'Set the path to the working tree' -complete -f -c git -l namespace -d 'Set the namespace' -complete -f -c git -l bare -d 'Treat the repository as bare' -complete -f -c git -l no-replace-objects -d 'Do not use replacement refs to replace git objects' -complete -f -c git -l literal-pathspecs -d 'Treat pathspecs literally' -complete -f -c git -l glob-pathspecs -d 'Treat pathspecs as globs' -complete -f -c git -l noglob-pathspecs -d "Don't treat pathspecs as globs" -complete -f -c git -l icase-pathspecs -d 'Match pathspecs case-insensitively' +complete -f -c git -n '__fish_git_needs_command' -l version -d 'Display version' +complete -x -c git -n '__fish_git_needs_command' -s C -a '(__fish_complete_directories)' -d 'Run as if git was started in this directory' +complete -x -c git -n '__fish_git_needs_command' -s c -a '(command git config -l ^/dev/null | string replace = \t)' -d 'Set a configuration option' +complete -x -c git -n '__fish_git_needs_command' -l exec-path -a '(__fish_git_complete_directories)' -d 'Get or set the path to the git programs' +complete -f -c git -n '__fish_git_needs_command' -l html-path -d 'Print the path to the html documentation' +complete -f -c git -n '__fish_git_needs_command' -l man-path -d 'Print the path to the man documentation' +complete -f -c git -n '__fish_git_needs_command' -l info-path -d 'Print the path to the info documentation' +complete -f -c git -n '__fish_git_needs_command' -s p -l paginate -d 'Pipe output into a pager' +complete -f -c git -n '__fish_git_needs_command' -l no-pager -d 'Do not pipe output into a pager' +complete -f -c git -n '__fish_git_needs_command' -l git-dir -d 'Set the path to the repository' +complete -f -c git -n '__fish_git_needs_command' -l work-tree -d 'Set the path to the working tree' +complete -f -c git -n '__fish_git_needs_command' -l namespace -d 'Set the namespace' +complete -f -c git -n '__fish_git_needs_command' -l bare -d 'Treat the repository as bare' +complete -f -c git -n '__fish_git_needs_command' -l no-replace-objects -d 'Do not use replacement refs to replace git objects' +complete -f -c git -n '__fish_git_needs_command' -l literal-pathspecs -d 'Treat pathspecs literally' +complete -f -c git -n '__fish_git_needs_command' -l glob-pathspecs -d 'Treat pathspecs as globs' +complete -f -c git -n '__fish_git_needs_command' -l noglob-pathspecs -d "Don't treat pathspecs as globs" +complete -f -c git -n '__fish_git_needs_command' -l icase-pathspecs -d 'Match pathspecs case-insensitively' # Options shared between multiple commands complete -f -c git -n '__fish_git_using_command log show diff-tree rev-list' -l pretty -a 'oneline short medium full fuller email raw format:' -- cgit v1.2.3