Skip to content

Instantly share code, notes, and snippets.

@serby
Created May 4, 2011 22:19
Show Gist options
  • Select an option

  • Save serby/956157 to your computer and use it in GitHub Desktop.

Select an option

Save serby/956157 to your computer and use it in GitHub Desktop.
maiden bash completion
_maiden()
{
local cur prev opts
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h -l -b -v -q"
if [ -e "Maiden.php" ]
then
targets=`echo ""| maiden -b | sort -u`
COMPREPLY=( $(compgen -W "${targets}" -- ${cur}) )
return 0
fi
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _maiden maiden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment