forked from tj/git-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement completion for
git coauthor
(tj#1074)
- Loading branch information
1 parent
e793f89
commit dee7c7f
Showing
4 changed files
with
121 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
complete -e blah | ||
|
||
function __fish_git_arg_number -a number | ||
set -l cmd (commandline -opc) | ||
test (count $cmd) -eq $number | ||
end | ||
|
||
function __fish_git_extra_coauthor_name | ||
printf '%s\n' 'a' 'apple' 'ann' | ||
end | ||
|
||
function __fish_git_extra_coauthor_email | ||
set -l cmd (commandline -opc) | ||
|
||
set -l value $cmd[3] | ||
printf '%s\n' 'n' 'n1' 'n2' "$value" | ||
end | ||
|
||
complete -c blah -f -n '__fish_git_using_command coauthor; and __fish_git_arg_number 2' -a '(__fish_git_extra_coauthor_name)' | ||
complete -c blah -f -n '__fish_git_using_command coauthor; and __fish_git_arg_number 3' -a '(__fish_git_extra_coauthor_email)' |