From 640a840d2e94f0fc245ef8632050c37af23c6b94 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 15 Apr 1999 18:21:49 +0000 Subject: zsh-3.1.5-pws-13 --- Completion/Base/_brace_parameter | 2 +- Completion/Base/_long_options | 9 ++++++--- Completion/Base/_subscript | 13 +++++-------- Completion/Base/_vars | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Completion/Base') diff --git a/Completion/Base/_brace_parameter b/Completion/Base/_brace_parameter index 092376e78..3fab8510a 100644 --- a/Completion/Base/_brace_parameter +++ b/Completion/Base/_brace_parameter @@ -2,4 +2,4 @@ # Simple but without spiffy suffix handling: compgen -v -S '} ' -compadd -S '} ' -r '-:?#%+=[/' - "${(@)${${${(f)$(typeset)}%%\=*}##* }:gs/'//}" +compadd -S '} ' -r '-:?#%+=[/' - "${(@)${(@)${(@f)$(set)}%%\=*}:gs/'//}" diff --git a/Completion/Base/_long_options b/Completion/Base/_long_options index a5d92632c..cc3175592 100644 --- a/Completion/Base/_long_options +++ b/Completion/Base/_long_options @@ -2,9 +2,12 @@ # This function tries to automatically complete long option names. For # this it invokes the command from the line with the `--help' option -# and then parses the output to find possible option names. For -# options that get an argument after a `=', the function also tries to -# automatically find out what should be complete as the argument. +# and then parses the output to find possible option names, so you +# should be careful to make sure that this function is not called for +# a command that does not support this option. +# +# For options that get an argument after a `=', the function also tries +# to automatically find out what should be complete as the argument. # The possible completions for option-arguments can be described with # the arguments to this function. This is done by giving pairs of # patterns and actions as consecutive arguments. The actions specify diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript index 670739a9a..e783d04e7 100644 --- a/Completion/Base/_subscript +++ b/Completion/Base/_subscript @@ -1,10 +1,7 @@ #defcomp -subscript- -local ret=1 - -_compalso -math- && ret=0 - -[[ ${(Pt)${compstate[parameter]}} = assoc* ]] && - compgen -k "( ${(kP)${compstate[parameter]}} )" && ret=0 - -return ret +if [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then + compgen -S ']' -k "( ${(kP)${compstate[parameter]}} )" +else + _compalso -math- +fi diff --git a/Completion/Base/_vars b/Completion/Base/_vars index 92de51e1f..497a9316f 100644 --- a/Completion/Base/_vars +++ b/Completion/Base/_vars @@ -1,3 +1,3 @@ -#defcomp -math- getopts read unset vared +#defcomp getopts read unset vared compgen -v -- cgit 1.4.1