symfony2.plugin.zsh 658 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
23
24
25
alias sf='`_symfony_console`'
alias sfcl='sf cache:clear'
alias sfcw='sf cache:warmup'
alias sfroute='sf router:debug'
alias sfcontainer='sf container:debug'
26
alias sfgb='sf generate:bundle'