From 780b7ae86edf032ee5343d2afc54cda0eb3a67f3 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 20 Aug 1999 07:49:07 +0000 Subject: zsh-workers/7454 --- Completion/Base/_arguments | 21 +++++++++++++++------ Completion/Core/_message | 2 -- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 5e0d35d44..9e9c4e892 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -3,7 +3,9 @@ # Complete the arguments of the current command according to the # descriptions given as arguments to this function. -local long args rest ws cur nth def nm expl descr action opt arg tmp +setopt localoptions extendedglob + +local long args rest ws cur nth def nm expl descr action opt arg tmp ret=1 # Associative arrays used to collect information about the options. @@ -336,10 +338,17 @@ else # We aren't in an argument directly after a option name, so # all option names are possible matches. - _description expl option - compadd "$expl[@]" - "${(@k)opts}" "${(@k)mopts}" \ - "${(@k)dopts}" "${(@k)dmopts}" \ - "${(@k)odopts}" "${(@k)odmopts}" + if [[ "$compconfig[option_prefix]" != *(short|all)* || + "$PREFIX" = -* ]]; then + _description expl option + compadd "$expl[@]" - "${(@k)opts}" "${(@k)mopts}" \ + "${(@k)dopts}" "${(@k)dmopts}" \ + "${(@k)odopts}" "${(@k)odmopts}" && ret=0 + fi + [[ $#long -ne 0 && + ( "$compconfig[option_prefix]" != *(long|all)* || + "$PREFIX" = --* ) ]] && \ + _long_options && ret=0 fi fi @@ -362,7 +371,7 @@ else # An empty action means that we should just display a message. _message "$descr" - return 1 + return ret elif [[ "$action[1]" = \( ]]; then # Anything inside `(...)' is added directly. diff --git a/Completion/Core/_message b/Completion/Core/_message index 7f353b7c0..e36d8b36e 100644 --- a/Completion/Core/_message +++ b/Completion/Core/_message @@ -14,6 +14,4 @@ if [[ -n "$format" ]]; then compadd -X "${format//\\%d/$1}" -n '' fi compstate[force_list]=yes -else - compadd -n '' fi -- cgit 1.4.1