Merge pull request #9180 from svick/simplify-completion
Simplify completions scripts
This commit is contained in:
commit
f63839ddd6
2 changed files with 2 additions and 6 deletions
|
@ -1,14 +1,12 @@
|
||||||
#!/bin/bash
|
|
||||||
# bash parameter completion for the dotnet CLI
|
# bash parameter completion for the dotnet CLI
|
||||||
|
|
||||||
_dotnet_bash_complete()
|
_dotnet_bash_complete()
|
||||||
{
|
{
|
||||||
local word=${COMP_WORDS[COMP_CWORD]}
|
local word=${COMP_WORDS[COMP_CWORD]}
|
||||||
local dotnetPath=${COMP_WORDS[1]}
|
|
||||||
|
|
||||||
local completions=("$(dotnet complete --position ${COMP_POINT} "${COMP_LINE}")")
|
local completions=("$(dotnet complete --position ${COMP_POINT} "${COMP_LINE}")")
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -f -F _dotnet_bash_complete dotnet
|
complete -f -F _dotnet_bash_complete dotnet
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
|
|
||||||
_dotnet_zsh_complete()
|
_dotnet_zsh_complete()
|
||||||
{
|
{
|
||||||
local dotnetPath=$words[1]
|
|
||||||
|
|
||||||
local completions=("$(dotnet complete "$words")")
|
local completions=("$(dotnet complete "$words")")
|
||||||
|
|
||||||
reply=( "${(ps:\n:)completions}" )
|
reply=( "${(ps:\n:)completions}" )
|
||||||
}
|
}
|
||||||
|
|
||||||
compctl -K _dotnet_zsh_complete dotnet
|
compctl -K _dotnet_zsh_complete dotnet
|
||||||
|
|
Loading…
Reference in a new issue