diff --git a/completions/runny.bash b/completions/runny.bash index 38fda07..4fc9b61 100644 --- a/completions/runny.bash +++ b/completions/runny.bash @@ -1,3 +1,9 @@ #!/usr/bin/env bash -complete -W "$(runny | cut -f1)" runny +# See https://opensource.com/article/18/3/creating-bash-completion-script +_runny_completions() { + runny_commands=$(runny | cut -f1) + COMPREPLY=($(compgen -W "${runny_commands}" "${COMP_WORDS[1]}")) +} + +complete -F _runny_completions runny