Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 909 Bytes
# dotnet suggest shell complete script start
_dotnet_bash_complete()
{
local fullpath=`type -p ${COMP_WORDS[0]}`
local escaped_comp_line=$(echo "$COMP_LINE" | sed s/\"/'\\\"'/g)
local completions=`dotnet-suggest get --executable "${fullpath}" --position ${COMP_POINT} -- "${escaped_comp_line}"`
if [ "${#COMP_WORDS[@]}" != "2" ]; then
return
fi
local IFS=$'\n'
local suggestions=($(compgen -W "$completions"))
if [ "${#suggestions[@]}" == "1" ]; then
local number="${suggestions[0]/%\ */}"
COMPREPLY=("$number")
else
for i in "${!suggestions[@]}"; do
suggestions[$i]="$(printf '%*s' "-$COLUMNS" "${suggestions[$i]}")"
done
COMPREPLY=("${suggestions[@]}")
fi
}
complete -F _dotnet_bash_complete `dotnet-suggest list`
export DOTNET_SUGGEST_SCRIPT_VERSION="1.0.0"
# dotnet suggest shell complete script end
You can’t perform that action at this time.