Skip to content

Commit aeaf5f4

Browse files
committed
refactor(plugin): phpcli => ahccli
1 parent e625fd0 commit aeaf5f4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ahccli.plugin.zsh

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------
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.
44
# AUTHOR: Jitendra Adhikari ([email protected])
55
# VERSION: 0.0.1
66
# LICENSE: MIT
@@ -9,18 +9,18 @@
99
# Check https://github.com/adhocore/php-cli#autocompletion
1010
# ------------------------------------------------------------------------------
1111

12-
# PHPCli command completion
13-
_phpcli_command_list () {
12+
# AhcCli command completion
13+
_ahccli_command_list () {
1414
command $1 --help 2>/dev/null | sed "1,/Commands/d" | grep -v Run | awk '/ [a-z]+ / { print $2 }'
1515
}
1616

17-
# PHPCli option completion
18-
_phpcli_option_list () {
17+
# AhcCli option completion
18+
_ahccli_option_list () {
1919
command $1 $2 --help 2>/dev/null | sed '1,/Options/d' | gawk 'match($0, / .*(--[a-z-]+)(\.\.\.)?. /, o) { print o[1] }'
2020
}
2121

22-
# PHPCli compdef handler
23-
_phpcli () {
22+
# AhcCli compdef handler
23+
_ahccli () {
2424
local curcontext="$curcontext" state line cmd subcmd
2525
typeset -A opt_args
2626
_arguments \
@@ -31,14 +31,14 @@ _phpcli () {
3131
subcmd=`echo $line | awk '{print $1}'`
3232

3333
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) ;;
3636
esac
3737
}
3838

3939
#
4040
# Register commands for autocompletion below:
4141
#
42-
# format: compdef _phpcli <cmd>
43-
# example: compdef _phpcli phint
42+
# format: compdef _ahccli <cmd>
43+
# example: compdef _ahccli phint
4444
#

0 commit comments

Comments
 (0)