diff options
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/_arguments | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 60b07b2e4..5deef344b 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -533,8 +533,34 @@ else if [[ -z "$action" ]]; then # An empty action means that we should just display a message. + _message "$descr" return ret + + elif [[ "$action" = \(\(*\)\) ]]; then + + # ((...)) contains literal strings with descriptions. + + eval ws\=\( "${action[3,-3]}" \) + + compadd -D ws - "${(@)ws%%:*}" + + if (( $#ws )); then + beg=1 + for nth in "$ws[@]"; do + tmp="${#nth%%:*}" + [[ tmp -gt beg ]] && beg="$tmp" + done + tmp='' + for nth in "$ws[@]"; do + tmp="$tmp +${(r:beg:: :)nth%%:*} -- ${nth#*:}" + done + tmp="$tmp[2,-1]" + compadd "$expl[@]" -y tmp - "${(@)ws%%:*}" + else + _message "$descr" + fi elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly. |