fishでSymfonyのコマンドを補完してみた

https://twitter.com/polidog/status/868134541067657217
Zshだとプラグイン用意されている。
oh-my-zsh/plugins/symfony2 at master · robbyrussell/oh-my-zsh · GitHub
Fishだと用意されていないので、自分で作ってみた。
# ~/.config/fish/conf.d/symfony.fish
function _symfony_console
php (find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)
end
function _symfony_get_command_list
_symfony_console --no-ansi | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
end
complete -f -c "console" -a "(_symfony_get_command_list)"
しかしanyenv使えなかったり地味に辛いのでzshに戻したくなっている・・・。