Created
September 1, 2014 08:00
-
-
Save saksmt/47a60373c70072b636c4 to your computer and use it in GitHub Desktop.
Bash completion for app/console(symfony2)
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
#!/bin/bash | |
_sf_console() | |
{ | |
local curr=${COMP_WORDS[COMP_CWORD]} | |
local out='' | |
local str=" | sed -r 's/\s+.*$//' | xargs" | |
if [[ -e "app/console" ]]; then | |
out="app/console list --raw"$str | |
else if [[ -e "console" ]]; then | |
out="console list --raw"$str | |
fi; fi | |
COMPREPLY=( $(compgen -W "$(eval $out)" -- "$curr") ) | |
} | |
complete -F _sf_console app/console | |
complete -F _sf_console console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment