Last active
February 5, 2017 21:09
-
-
Save danielhauck/8e207e828b02237926d88a12e88b0568 to your computer and use it in GitHub Desktop.
Symfony Bash Completion
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() | |
{ | |
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