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

_symfony2_get_command_list () {
4
	php $(find . -maxdepth 2 -mindepth 1 -name 'console')  --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
Andrew Tch's avatar
Andrew Tch committed
5
6
7
}

_symfony2 () {
8
  if [ -f $(find . -maxdepth 2 -mindepth 1 -name 'console')  ]; then
Andrew Tch's avatar
Andrew Tch committed
9
10
11
12
    compadd `_symfony2_get_command_list`
  fi
}

13
compdef _symfony2 $(find . -maxdepth 2 -mindepth 1 -name 'console')
Rui Marinho's avatar
Rui Marinho committed
14
compdef _symfony2 sf
15
16

#Alias
17
18
19
20
21
alias sf='php $(find . -maxdepth 2 -mindepth 1 -name 'console') '
alias sfcl='php $(find . -maxdepth 2 -mindepth 1 -name 'console')  cache:clear'
alias sfroute='php $(find . -maxdepth 2 -mindepth 1 -name 'console')  router:debug'
alias sfcontainer='php $(find . -maxdepth 2 -mindepth 1 -name 'console') container:debug'
alias sfgb='php $(find . -maxdepth 2 -mindepth 1 -name 'console')  generate:bundle'
Rui Marinho's avatar
Rui Marinho committed
22