Create a gist now

Instantly share code, notes, and snippets.

@hauckd /symfony
Last active Feb 5, 2017

Symfony Bash Completion
## add me to /etc/bash_completion.d/
## cp FILE /etc/bash_completion.d/
## reload completion
## exec bash
_available_commands()
{
bin/console list --raw | awk '{print $1}'
}
_symfony()
{
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 _symfony bin/console
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment