1
1
# ------------------------------------------------------------------------------
2
- # FILE: phpcli .plugin.zsh
3
- # DESCRIPTION: oh-my-zsh phpcli plugin file.
2
+ # FILE: ahccli .plugin.zsh
3
+ # DESCRIPTION: oh-my-zsh ahccli plugin file.
4
4
# AUTHOR: Jitendra Adhikari ([email protected] )
5
5
# VERSION: 0.0.1
6
6
# LICENSE: MIT
9
9
# Check https://github.com/adhocore/php-cli#autocompletion
10
10
# ------------------------------------------------------------------------------
11
11
12
- # PHPCli command completion
13
- _phpcli_command_list () {
12
+ # AhcCli command completion
13
+ _ahccli_command_list () {
14
14
command $1 --help 2> /dev/null | sed " 1,/Commands/d" | grep -v Run | awk ' / [a-z]+ / { print $2 }'
15
15
}
16
16
17
- # PHPCli option completion
18
- _phpcli_option_list () {
17
+ # AhcCli option completion
18
+ _ahccli_option_list () {
19
19
command $1 $2 --help 2> /dev/null | sed ' 1,/Options/d' | gawk ' match($0, / .*(--[a-z-]+)(\.\.\.)?. /, o) { print o[1] }'
20
20
}
21
21
22
- # PHPCli compdef handler
23
- _phpcli () {
22
+ # AhcCli compdef handler
23
+ _ahccli () {
24
24
local curcontext=" $curcontext " state line cmd subcmd
25
25
typeset -A opt_args
26
26
_arguments \
@@ -31,14 +31,14 @@ _phpcli () {
31
31
subcmd=` echo $line | awk ' {print $1}' `
32
32
33
33
case $state in
34
- cmd) compadd $( _phpcli_command_list $cmd ) ;;
35
- opts) compadd $( _phpcli_option_list $cmd $subcmd ) ;;
34
+ cmd) compadd $( _ahccli_command_list $cmd ) ;;
35
+ opts) compadd $( _ahccli_option_list $cmd $subcmd ) ;;
36
36
esac
37
37
}
38
38
39
39
#
40
40
# Register commands for autocompletion below:
41
41
#
42
- # format: compdef _phpcli <cmd>
43
- # example: compdef _phpcli phint
42
+ # format: compdef _ahccli <cmd>
43
+ # example: compdef _ahccli phint
44
44
#
0 commit comments