mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
added completion for git add --patch
This commit is contained in:
parent
924b646b79
commit
568de8157a
@ -18,6 +18,10 @@ function __fish_git_remotes
|
|||||||
command git remote
|
command git remote
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function __fish_git_modified_files
|
||||||
|
command git status -s | grep -e "^ M" | sed "s/^ M //"
|
||||||
|
end
|
||||||
|
|
||||||
function __fish_git_ranges
|
function __fish_git_ranges
|
||||||
set -l from (commandline -ot | perl -ne 'if (index($_, "..") > 0) { my @parts = split(/\.\./); print $parts[0]; }')
|
set -l from (commandline -ot | perl -ne 'if (index($_, "..") > 0) { my @parts = split(/\.\./); print $parts[0]; }')
|
||||||
if test -z "$from"
|
if test -z "$from"
|
||||||
@ -93,6 +97,7 @@ complete -f -c git -n '__fish_git_using_command show-branch' -a '(__fish_git_hea
|
|||||||
|
|
||||||
### add
|
### add
|
||||||
complete -c git -n '__fish_git_needs_command' -a add -d 'Add file contents to the index'
|
complete -c git -n '__fish_git_needs_command' -a add -d 'Add file contents to the index'
|
||||||
|
complete -f -c git -n '__fish_git_using_command add; and __fish_contains_opt -s p patch' -a (__fish_git_modified_files)
|
||||||
# TODO options
|
# TODO options
|
||||||
|
|
||||||
### checkout
|
### checkout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user