Created
September 1, 2012 17:11
-
-
Save podhmo/3580622 to your computer and use it in GitHub Desktop.
This file contains 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
_templer(){ | |
local cur opts templates | |
cur=${COMP_WORDS[COMP_CWORD]} | |
opts="--help --make-config-file --list --version" | |
templates="`templer --list | grep ':' | cut -d ':' -f 1`" | |
if [[ ${cur} == "" ]] ; then | |
COMPREPLY=($( compgen -W "${opts} ${templates}" -- $cur)) | |
elif [[ ${cur} == -* ]] ; then | |
COMPREPLY=($( compgen -W "${opts}" -- $cur)) | |
else | |
COMPREPLY=($( compgen -W "${templates}" -- $cur)) | |
fi | |
} | |
complete -F _templer templer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment