From 6fb866183d84e53fa009853691e5c0bdd101820b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 4 Jan 2015 22:24:55 +0100 Subject: [PATCH] Remove composer.json file requirement This is because we can't be sure which arguments require a json file and which don't, so the `else' statement will always be difficult to check for correctness. --- plugins/composer/composer.plugin.zsh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index 97207242a..7f70e3d72 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -20,18 +20,15 @@ _composer () { _arguments \ '1: :->command'\ '*: :->args' - if [ -f composer.json ]; then - case $state in - command) - compadd `_composer_get_command_list` - ;; - *) - compadd `_composer_get_required_list` - ;; - esac - else - compadd create-project init search selfupdate show - fi + + case $state in + command) + compadd $(_composer_get_command_list) + ;; + *) + compadd $(_composer_get_required_list) + ;; + esac } compdef _composer composer