mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 15:20:08 +00:00
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
This commit is contained in:
parent
0cc3afe277
commit
5f4e8e57da
1 changed files with 3 additions and 2 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue