Skip to content

Instantly share code, notes, and snippets.

@asears
Created November 21, 2021 19:37
Show Gist options
  • Select an option

  • Save asears/0dcaff1ee3fa9efd7997b4a3c83767ae to your computer and use it in GitHub Desktop.

Select an option

Save asears/0dcaff1ee3fa9efd7997b4a3c83767ae to your computer and use it in GitHub Desktop.
bashrc dotnet cli param completion
# bash parameter completion for the dotnet CLI
_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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment