symfony2.plugin.zsh 746 Bytes
Newer Older
Andrew Tch's avatar
Andrew Tch committed
1
2
# Symfony2 basic command completion

Ben Zörb's avatar
Ben Zörb committed
3
_symfony_console () {
4
  echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
Ben Zörb's avatar
Ben Zörb committed
5
6
}

Andrew Tch's avatar
Andrew Tch committed
7
_symfony2_get_command_list () {
8
   `_symfony_console` --no-ansi | sed "1,/Available commands/d" | awk '/^  ?[a-z]+/ { print $1 }'
Andrew Tch's avatar
Andrew Tch committed
9
10
11
}

_symfony2 () {
Ben Zörb's avatar
Ben Zörb committed
12
   compadd `_symfony2_get_command_list`
Andrew Tch's avatar
Andrew Tch committed
13
14
}

Ben Zörb's avatar
Ben Zörb committed
15
compdef _symfony2 '`_symfony_console`'
16
17
compdef _symfony2 'app/console'
compdef _symfony2 'bin/console'
Rui Marinho's avatar
Rui Marinho committed
18
compdef _symfony2 sf
19
20

#Alias
Ben Zörb's avatar
Ben Zörb committed
21
22
alias sf='`_symfony_console`'
alias sfcl='sf cache:clear'
Darius Grigalevicius's avatar
Darius Grigalevicius committed
23
alias sfsr='sf server:run -vvv'
Ben Zörb's avatar
Ben Zörb committed
24
25
26
alias sfcw='sf cache:warmup'
alias sfroute='sf router:debug'
alias sfcontainer='sf container:debug'
27
alias sfgb='sf generate:bundle'
28
29
alias sfdev='sf --env=dev'
alias sfprod='sf --env=prod'