symfony2.plugin.zsh 592 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 () {
Ben Zörb's avatar
Ben Zörb committed
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`'
Rui Marinho's avatar
Rui Marinho committed
16
compdef _symfony2 sf
17
18

#Alias
Ben Zörb's avatar
Ben Zörb committed
19
20
21
22
23
24
alias sf='`_symfony_console`'
alias sfcl='sf cache:clear'
alias sfcw='sf cache:warmup'
alias sfroute='sf router:debug'
alias sfcontainer='sf container:debug'
alias sfgb='sf generate:bundle'