1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-15 16:23:15 +08:00
ohmyzsh-mirror/plugins/symfony2/symfony2.plugin.zsh

42 lines
1.4 KiB
Bash

# Symfony2 basic command completion
#
# DEPRECATION WARNING: This plugin is deprecated and will be removed in a future release.
# Please migrate to the unified 'symfony' plugin which supports all Symfony versions.
# Simply change 'symfony2' to 'symfony' in your .zshrc plugins list.
#
echo "⚠️ WARNING: The 'symfony2' plugin is deprecated. Please use the unified 'symfony' plugin instead." >&2
echo " Change 'symfony2' to 'symfony' in your .zshrc plugins list." >&2
_symfony_console () {
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
}
_symfony2_get_command_list () {
`_symfony_console` --no-ansi --no-debug | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
}
_symfony2 () {
compadd `_symfony2_get_command_list`
}
compdef _symfony2 '`_symfony_console`'
compdef _symfony2 'app/console'
compdef _symfony2 'bin/console'
compdef _symfony2 sf
#Alias
alias sf='`_symfony_console`'
alias sfcl='sf cache:clear'
alias sfsr='sf server:run -vvv'
alias sfcw='sf cache:warmup'
alias sfroute='sf debug:router'
alias sfcontainer='sf debug:container'
alias sfgb='sf generate:bundle'
alias sfgc='sf generate:controller'
alias sfgcom='sf generate:command'
alias sfge='sf doctrine:generate:entity'
alias sfsu='sf doctrine:schema:update'
alias sfdc='sf doctrine:database:create'
alias sfdev='sf --env=dev'
alias sfprod='sf --env=prod'