Enables shell autocompletion for tools based on theSymfony Console(Symfony framework, Composer, PHPSpec, Behat, etc.)
brew install bash-completion
) and enable it by adding source $(brew --prefix)/etc/bash_completion
at the end of your .bashrc
.Install the tool globally with Composer :
composer global require bamarni/symfony-console-autocomplete
Add the following line at the end of your shell configuration file (~/.bash_profile
or ~/.zshrc
) :
eval "$(symfony-autocomplete)"
Close / re-open your terminal window and you're ready to go!
If you don't like all the magic from the quick setup and want to go with a more standard way,you can dump a static completion file for a given tool :
symfony-autocomplete composer
This will print the completion script for Composer to stdout. The output should be savedat a specific location depending on your OS / setup. Here are a few examples :
# BASH - Ubuntu / Debian
symfony-autocomplete composer | sudo tee /etc/bash_completion.d/composer
# BASH - Mac OSX (with Homebrew "bash-completion")
symfony-autocomplete composer > $(brew --prefix)/etc/bash_completion.d/composer
# ZSH - Config file
symfony-autocomplete composer > ~/.composer_completion && echo "source ~/.composer_completion" >> ~/.zshrc
# FISH
symfony-autocomplete --shell=fish composer > ~/.config/fish/completions/composer.fish
If you are running an environment that does not have automatic execution of PHP scripts, then you will need tocall PHP and the script in question :
symfony-autocomplete "php ./artisan"
To update the tool to a new version use :
composer global update bamarni/symfony-console-autocomplete
In order to get completion running, you shouldn't prepend php
at the beginning of the command :
app/console [TAB]
By default, completion for your aliases won't be enabled. If you're using aliases(e.g. "c" for "composer", "pspec" for "phpspec", etc.), you have to pass them explicitly :
symfony-autocomplete --aliases=c --aliases=pspec
SHELL
environment variableIf you connect to your container using something similar to docker exec -it container bash
thenyou may find that the completions cannot be built due to an inability to locate the SHELL
environment variable. This has been reported in https://github.com/bamarni/symfony-console-autocomplete/issues/32
A solution is to supply the SHELL
environment variable as part of the docker exec
command:
docker exec -e SHELL=bash -it container bash
All tools using the Symfony Console component are supported,here is a non-exhaustive list :
BASH/ZSH auto-complete for Symfony Console applications This package provides automatic (tab) completion in BASH and ZSH for Symfony Console Component based applications. With zero configuration, this
Console模块用于跟踪调试的API,可根据调试需求输出日志,协助开发人员定位业务逻辑问题。 方法: log: 记录用户日志 info: 记录用户提示信息 warn: 记录用户警告信息 error: 记录用户错误信息 assert: 断言操作 权限: 5+功能模块(permissions) { // ... "permissions":{ // ... "Console": { "de
Console模块用于跟踪调试的API,可根据调试需求输出日志,协助开发人员定位业务逻辑问题。 方法: log: 记录用户日志 info: 记录用户提示信息 warn: 记录用户警告信息 error: 记录用户错误信息 assert: 断言操作 权限: 5+功能模块(permissions) { // ... "permissions":{ // ... "Console": { "de
This plugin is meant to ensure that console.log() is as useful as it can be. It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows. If you are happy with how console.log() works fo
Node.js console是一个全局对象,用于向stdout和stderr打印不同级别的消息。 有内置方法可用于打印信息,警告和错误消息。 它在目标是文件或终端时以同步方式使用,而在目标是管道时以异步方式使用。 控制台方法 以下是控制台全局对象可用的方法列表。 Sr.No. 方法和描述 1 console.log([data][, ...]) 用换行符打印到stdout。 这个函数可以在pri
MOAC developed based on the Ethereum project. It also implements a javascript runtime environment (JSRE) that can be used in either interactive (console) or non-interactive (script) mode. MOAC Javascr