mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-17 16:00:19 +00:00
Avoid defining local variable options
zsh has the built in variable 'options'. zsh sometimes behaves weirdly when there is a local variable that is named 'options'
This commit is contained in:
+6
-6
@@ -36,8 +36,8 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
local -a options
|
||||
options=(
|
||||
local -a command_options
|
||||
command_options=(
|
||||
'--version[Show the program version and exit]'
|
||||
'--filter[Set the filter, e.g. installed]'
|
||||
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
|
||||
@@ -107,23 +107,23 @@ done
|
||||
|
||||
if [[ -z "$cmd" ]]
|
||||
then
|
||||
_arguments -s -w : $options \
|
||||
_arguments -s -w : $command_options \
|
||||
":action:($actions)"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$cmd" in
|
||||
search)
|
||||
_arguments : $options \
|
||||
_arguments : $command_options \
|
||||
':type:(name details group file)' \
|
||||
':data: :'
|
||||
;;
|
||||
refresh)
|
||||
_arguments -s -w : $options \
|
||||
_arguments -s -w : $command_options \
|
||||
'--force'
|
||||
;;
|
||||
*)
|
||||
_arguments -s -w : $options
|
||||
_arguments -s -w : $command_options
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user