4bf174c38b2b8ff9b000accf63155d9756c63a02

Author
hacfi <philipp.wahala@gmail.com>
Committer
hacfi <philipp.wahala@gmail.com>
Date

Message

Autocomplete composer default methods if composer.json is not available

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!

Diff

 1diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
 2index c9b762d072ab2a3a0c7df36f76f91c6bc624da6b..639677ba64318a1ba645b70ae03a0eb1fa7ae9b0 100644
 3--- a/plugins/composer/composer.plugin.zsh
 4+++ b/plugins/composer/composer.plugin.zsh
 5@@ -13,6 +13,8 @@ _composer_get_command_list () {
 6 _composer () {
 7   if [ -f composer.json ]; then
 8     compadd `_composer_get_command_list`
 9+  else
10+    compadd create-project init search selfupdate show
11   fi
12 }
13 
14@@ -26,4 +28,4 @@ alias ci='composer install'
15 alias ccp='composer create-project'
16 
17 # install composer in the current directory
18-alias cget='curl -s https://getcomposer.org/installer | php'
19+alias cget='curl -s https://getcomposer.org/installer | php'