diff options
author | 2015-09-22 20:24:54 +0200 | |
---|---|---|
committer | 2015-09-22 20:24:54 +0200 | |
commit | c6d808a0d8de84116b353b1a49b04a7c43a7beda (patch) | |
tree | 2c04fcd8aa3fa2d1a60f6e7958a0107bc148c714 /share | |
parent | 4f12821ca8a2d79f1f810f8cbd289a1ea120ca02 (diff) |
git completions: Switch more to `string`
Diffstat (limited to 'share')
-rw-r--r-- | share/completions/git.fish | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/share/completions/git.fish b/share/completions/git.fish index afca815e..c534b7e6 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -70,8 +70,8 @@ function __fish_git_using_command end # aliased command - set -l aliased (command git config --get "alias.$cmd[2]" ^ /dev/null | sed 's/ .*$//') - if [ $argv[1] = "$aliased" ] + set -l aliased (command git config --get "alias.$cmd[2]" ^ /dev/null | string split " ") + if [ $argv[1] = "$aliased[1]" ] return 0 end end @@ -121,8 +121,7 @@ function __fish_git_custom_commands # if any of these completion results match the name of the builtin git commands, # but it's simpler just to blacklist these names. They're unlikely to change, # and the failure mode is we accidentally complete a plumbing command. - set -l IFS \n - for name in (builtin complete -Cgit- | sed 's/^git-\([^[:space:]]*\).*/\1/') + for name in (string replace -r "^.*/git-([^/]*)" '$1' $PATH/git-*) switch $name case cvsserver receive-pack shell upload-archive upload-pack # skip these |