completion/dotnet: new completion
See: https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bashpull/2042/head
parent
86c1e3c043
commit
1a48bcc852
|
|
@ -0,0 +1,18 @@
|
|||
# shellcheck shell=bash
|
||||
about-completion "bash parameter completion for the dotnet CLI"
|
||||
# see https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bash
|
||||
|
||||
_dotnet_bash_complete()
|
||||
{
|
||||
local word=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
local completions
|
||||
completions="$(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
|
||||
if [ $? -ne 0 ]; then
|
||||
completions=""
|
||||
fi
|
||||
|
||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||
}
|
||||
|
||||
complete -f -F _dotnet_bash_complete dotnet
|
||||
Loading…
Reference in New Issue