git completions: Only take general options before command

This commit is contained in:
Fabian Homborg 2016-06-04 12:27:06 +02:00
parent 410d92ed61
commit 32a585a52b

View file

@ -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:'