diff --git a/features/src/dotnet/install.sh b/features/src/dotnet/install.sh index 5323862..cea45fc 100644 --- a/features/src/dotnet/install.sh +++ b/features/src/dotnet/install.sh @@ -3,3 +3,19 @@ apk update apk upgrade apk add dotnet7-sdk + +echo ' +# bash parameter completion for the dotnet CLI + +function _dotnet_bash_complete() +{ + local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n' # On Windows you may need to use use IFS=$'\r\n' + local candidates + + read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null) + + read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur") +} + +complete -f -F _dotnet_bash_complete dotnet +' >> $_REMOTE_USER_HOME/.bashrc