5 cur
=${COMP_WORDS[COMP_CWORD]}
6 prev
=${COMP_WORDS[COMP_CWORD-1]}
7 action
=${COMP_WORDS[1]}
10 "init-module"|
"propel-generate-crud"|
"propel-init-crud"|
"propel-init-admin"|
"generate:module"|
"propel:generate-crud"|
"propel:init-admin")
11 COMPREPLY
=( $
( compgen
-W "$( ls -1 apps 2>/dev/null | sed -e 's/ /\\ /g' | sed -e 's/\/$//g' )" -- $cur ) )
16 "init-project"|
"generate:project")
17 COMPREPLY
=( $
( compgen
-W "$( pwd | perl -pe "s
/^.
*?
([^\
/]+)$
/\
$1/g
" )" -- $cur ) )
22 "init-app"|
"generate:app")
23 COMPREPLY
=( $
( compgen
-W "frontend backend" -- $cur ) )
29 if (($COMP_CWORD == 3)); then
30 COMPREPLY
=( $
( compgen
-W 'go' -- $cur))
37 SYMFONY_VERSION
=$
( $prev -V |
sed 's/^symfony version //g' |
awk -F '.' '{print $1 "." $2;}' )
39 case "$SYMFONY_VERSION" in
41 # Versions less than 1.0 are not supported.
46 COMPREPLY
=( $
( compgen
-W "$( $prev -T | awk '/^ /' | cut -d ' ' -f 3 )" -- $cur ) )
50 COMPREPLY
=( $
( compgen
-W "$(
55 for line in $( $prev -T ); do
56 if [ $line != 'Available tasks:' ]; then
57 if [ ${line:0:2} == ' ' ]; then
58 TASK=$(echo $line | awk -F ':' '{print $2;}' | cut -d ' ' -f 1)
59 if [ -z $NAMESPACE ]; then
73 # Work-around bash_completion issue where bash interprets a colon as a separator.
74 # Work-around borrowed from the darcs work-around for the same issue.
75 local colonprefixes
=${cur%"${cur##*:}"}
76 local i
=${#COMPREPLY[*]}
77 while [ $
((--i)) -ge 0 ]; do
78 COMPREPLY
[$i]=${COMPREPLY[$i]#"$colonprefixes"}
88 "propel-generate-crud"|
"propel-init-crud"|
"propel-init-admin"|
"propel:generate-crud"|
"propel:init-admin")
89 if (($COMP_CWORD == 3)); then
90 COMPREPLY
=( $
( compgen
-W "$( find lib/model -maxdepth 1 -name '*.php' -exec basename '{}' '.php' ';' | grep -v 'Peer$' | tr [:upper:] [:lower:] )" -- $cur ) )
91 elif (($COMP_CWORD == 4)); then
92 COMPREPLY
=( $
( compgen
-W "$( find lib/model -maxdepth 1 -name '*.php' -exec basename '{}' '.php' ';' | grep -v 'Peer$' )" -- $cur ) )
106 complete
-F _symfony symfony