From 4bf174c38b2b8ff9b000accf63155d9756c63a02 Mon Sep 17 00:00:00 2001 From: hacfi Date: Wed, 13 Mar 2013 04:06:16 +0100 Subject: [PATCH] Autocomplete composer default methods if composer.json is not available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This plugin currently doesn't autocomplete composer commands if there is no composer.json in the current dir. However, the commands create-project, init, search, selfupdate and show are still useful without a composer.json! --- plugins/composer/composer.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index c9b762d0..639677ba 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -13,6 +13,8 @@ _composer_get_command_list () { _composer () { if [ -f composer.json ]; then compadd `_composer_get_command_list` + else + compadd create-project init search selfupdate show fi } @@ -26,4 +28,4 @@ alias ci='composer install' alias ccp='composer create-project' # install composer in the current directory -alias cget='curl -s https://getcomposer.org/installer | php' \ No newline at end of file +alias cget='curl -s https://getcomposer.org/installer | php'