mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-11 00:10:08 +00:00
Add file completion as optional argument
This commit is contained in:
parent
de769058b9
commit
2449e41248
1 changed files with 10 additions and 2 deletions
|
@ -7,11 +7,19 @@
|
||||||
|
|
||||||
# n98-magerun basic command completion
|
# n98-magerun basic command completion
|
||||||
_n98_magerun_get_command_list () {
|
_n98_magerun_get_command_list () {
|
||||||
n98-magerun.phar --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
|
$_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_n98_magerun () {
|
_n98_magerun () {
|
||||||
compadd `_n98_magerun_get_command_list`
|
_arguments '1: :->command' '*:optional arg:_files'
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
command)
|
||||||
|
compadd $(_n98_magerun_get_command_list)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _n98_magerun n98-magerun.phar
|
compdef _n98_magerun n98-magerun.phar
|
||||||
|
|
Loading…
Reference in a new issue