Created
August 24, 2011 21:37
-
-
Save charlieman/1169320 to your computer and use it in GitHub Desktop.
bash completion for Symfony2's console requires xmlstartlet to work
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
_symfony2() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=$(app/console list --xml | xmlstarlet sel -t -m "//namespaces//command" -v . -o " " | tr ":" "\:") | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
} | |
complete -F _symfony2 app/console | |
COMP_WORDBREAKS=${COMP_WORDBREAKS//:} | |
# ex: ts=4 sw=4 et filetype=sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment