Created
July 8, 2015 18:01
-
-
Save danielhauck/97f799d0316174b40a01 to your computer and use it in GitHub Desktop.
bash completion for markusblaschke/clitools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## add me to /etc/bash_completion.d/ | |
## cp FILE /etc/bash_completion.d/ | |
## reload completion | |
## exec bash | |
_available_commands() | |
{ | |
ct list --raw | awk '{print $1}' | |
} | |
_clitools() | |
{ | |
local cur | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev=${COMP_WORDS[COMP_CWORD-1]} | |
if [ $COMP_CWORD -eq 1 ] | |
then | |
COMPREPLY=( $( compgen -W '$(_available_commands)' -- $cur) ) | |
fi | |
} | |
complete -F _clitools ct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment