Merge pull request #1027 from zsh-users/variable_name_issue
Avoid defining local variable 'options'
This commit is contained in:
commit
fdcb0ef6f3
12
src/_pkcon
12
src/_pkcon
|
@ -36,8 +36,8 @@
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
local -a options
|
local -a command_options
|
||||||
options=(
|
command_options=(
|
||||||
'--version[Show the program version and exit]'
|
'--version[Show the program version and exit]'
|
||||||
'--filter[Set the filter, e.g. installed]'
|
'--filter[Set the filter, e.g. installed]'
|
||||||
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
|
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
|
||||||
|
@ -107,23 +107,23 @@ done
|
||||||
|
|
||||||
if [[ -z "$cmd" ]]
|
if [[ -z "$cmd" ]]
|
||||||
then
|
then
|
||||||
_arguments -s -w : $options \
|
_arguments -s -w : $command_options \
|
||||||
":action:($actions)"
|
":action:($actions)"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
search)
|
search)
|
||||||
_arguments : $options \
|
_arguments : $command_options \
|
||||||
':type:(name details group file)' \
|
':type:(name details group file)' \
|
||||||
':data: :'
|
':data: :'
|
||||||
;;
|
;;
|
||||||
refresh)
|
refresh)
|
||||||
_arguments -s -w : $options \
|
_arguments -s -w : $command_options \
|
||||||
'--force'
|
'--force'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_arguments -s -w : $options
|
_arguments -s -w : $command_options
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -339,9 +339,9 @@ _vboxmanage() {
|
||||||
&& ret=0
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
(modifyvm|export)
|
(modifyvm|export)
|
||||||
local -a options=(${(@f)"$(vboxmanage $words[1] | perl -wln -e 'm{(--[a-zA-Z_-]+) [^]|]+} and print qq{$1:arg}')"})
|
local -a command_options=(${(@f)"$(vboxmanage $words[1] | perl -wln -e 'm{(--[a-zA-Z_-]+) [^]|]+} and print qq{$1:arg}')"})
|
||||||
_arguments \
|
_arguments \
|
||||||
$options \
|
$command_options \
|
||||||
':machine:_vboxmachines'
|
':machine:_vboxmachines'
|
||||||
;;
|
;;
|
||||||
(controlvm)
|
(controlvm)
|
||||||
|
|
Loading…
Reference in New Issue