Merge pull request #9180 from svick/simplify-completion

Simplify completions scripts
This commit is contained in:
Livar 2018-05-01 10:13:17 -07:00 committed by GitHub
commit f63839ddd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -1,14 +1,12 @@
#!/bin/bash
# bash parameter completion for the dotnet CLI
_dotnet_bash_complete()
{
local word=${COMP_WORDS[COMP_CWORD]}
local dotnetPath=${COMP_WORDS[1]}
local completions=("$(dotnet complete --position ${COMP_POINT} "${COMP_LINE}")")
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
}
complete -f -F _dotnet_bash_complete dotnet
complete -f -F _dotnet_bash_complete dotnet

View file

@ -2,11 +2,9 @@
_dotnet_zsh_complete()
{
local dotnetPath=$words[1]
local completions=("$(dotnet complete "$words")")
reply=( "${(ps:\n:)completions}" )
}
compctl -K _dotnet_zsh_complete dotnet
compctl -K _dotnet_zsh_complete dotnet