diff options
author | Andrey Janzen <andrey@janzen.su> | 2013-07-26 00:37:11 +0700 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2015-02-10 19:32:59 +0100 |
commit | 5f4e8e57da117b5fc2325ea411aafc66053b8570 (patch) | |
tree | 2eabb2a04bcc0eabca81b65e186340e1fc3abe0e /plugins/composer/composer.plugin.zsh | |
parent | 0cc3afe27788e35d5f72236f41a7e4514c11491d (diff) | |
download | zsh-5f4e8e57da117b5fc2325ea411aafc66053b8570.tar.gz zsh-5f4e8e57da117b5fc2325ea411aafc66053b8570.tar.bz2 zsh-5f4e8e57da117b5fc2325ea411aafc66053b8570.zip |
Allow completion for 'composer.phar', not only 'composer'
Use $_comp_command1 for command list generation instead of 'composer':
`$_comp_command1` contains the command written in the command line.
This allows us to have a different composer name
Diffstat (limited to 'plugins/composer/composer.plugin.zsh')
-rw-r--r-- | plugins/composer/composer.plugin.zsh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index f75119c4a..324bc64a0 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -7,11 +7,11 @@ # Composer basic command completion _composer_get_command_list () { - composer --no-ansi | sed "1,/Available commands/d" | awk '/^\s*[a-z]+/ { print $1 }' + $_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^\s*[a-z]+/ { print $1 }' } _composer_get_required_list () { - composer show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' + $_comp_command1 show -s --no-ansi | sed '1,/requires/d' | awk 'NF > 0 && !/^requires \(dev\)/{ print $1 }' } _composer () { @@ -35,6 +35,7 @@ _composer () { } compdef _composer composer +compdef _composer composer.phar # Aliases alias c='composer' |