Skip to content

Instantly share code, notes, and snippets.

@nacho4d
Created June 10, 2013 16:37
Show Gist options
  • Save nacho4d/5750224 to your computer and use it in GitHub Desktop.
Save nacho4d/5750224 to your computer and use it in GitHub Desktop.
td_completion
# Taken from http://tldp.org/LDP/abs/html/tabexpansion.html
# file: td_completion
# td-completion.sh parameter-completion
_td_completion_func ()
{
local cur # pointer to current word
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
case "$cur" in
-*)
COMPREPLY=( $( compgen -W '-c -k -h -v --apikey --insecure --config --help --verbose' -- $cur ) );;
esac
return 0
}
complete -F _td_completion_func -o filenames td
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment