diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-24 00:53:26 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-24 00:53:26 +0000 |
commit | c9e0760f68994a0222f9b17d2c3f4ea0da337b98 (patch) | |
tree | 3851d688be4ede60ffeb1c3ac0ac118592cf76e1 /Completion | |
parent | e955563c02a7cf891ff950121a099855e82d867f (diff) | |
download | zsh-c9e0760f68994a0222f9b17d2c3f4ea0da337b98.tar.gz zsh-c9e0760f68994a0222f9b17d2c3f4ea0da337b98.tar.xz zsh-c9e0760f68994a0222f9b17d2c3f4ea0da337b98.zip |
manual/10204
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Base/_arguments | 9 | ||||
-rw-r--r-- | Completion/Base/_values | 9 | ||||
-rw-r--r-- | Completion/Core/_alternative | 8 | ||||
-rw-r--r-- | Completion/Core/_tags | 18 | ||||
-rw-r--r-- | Completion/Core/_wanted | 4 |
5 files changed, 35 insertions, 13 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 9a133617c..03f695629 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -236,14 +236,17 @@ if (( $# )) && comparguments -i "$autod" "$@"; then # A string in braces is evaluated. - _loop arguments expl "$descr" eval "$action[2,-2]" - + while _try arguments expl "$descr"; do + eval "$action[2,-2]" + done elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. eval "action=( $action )" - _loop arguments expl "$descr" "$action[@]" + while _try arguments expl "$descr"; do + "$action[@]" + done else # Otherwise we call it with the description-arguments. diff --git a/Completion/Base/_values b/Completion/Base/_values index 754147e05..e681d88ef 100644 --- a/Completion/Base/_values +++ b/Completion/Base/_values @@ -124,14 +124,17 @@ if compvalues -i "$@"; then # A string in braces is evaluated. - _loop arguments expl "$descr" eval "$action[2,-2]" - + while _try arguments expl "$descr"; do + eval "$action[2,-2]" + done elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. eval "action=( $action )" - _loop arguments expl "$descr" "$action[@]" + while _try arguments expl "$descr"; do + "$action[@]" + done else # Otherwise we call it with the description-arguments built above. diff --git a/Completion/Core/_alternative b/Completion/Core/_alternative index 482e9db51..3267ffeb7 100644 --- a/Completion/Core/_alternative +++ b/Completion/Core/_alternative @@ -50,13 +50,17 @@ while _tags; do # A string in braces is evaluated. - _loop "${def%%:*}" expl "$descr" eval "$action[2,-2]" + while _try "${def%%:*}" expl "$descr"; do + eval "$action[2,-2]" + done elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. eval "action=( $action )" - _loop "${def%%:*}" expl "$descr" "$action[@]" + while _try "${def%%:*}" expl "$descr"; do + "$action[@]" + done else # Otherwise we call it with the description-arguments built above. diff --git a/Completion/Core/_tags b/Completion/Core/_tags index b74e70264..2dfa56f9d 100644 --- a/Completion/Core/_tags +++ b/Completion/Core/_tags @@ -1,5 +1,17 @@ #autoload +local prev + +# A `--' as the first argument says that we should tell comptags to use +# the preceding function nesting level. This is only documented here because +# if everythings goes well, users won't have to worry about it and should +# not mess with it. + +if [[ "$1" = -- ]]; then + prev=- + shift +fi + if (( $# )); then # We have arguments: the tags supported in this context. @@ -33,7 +45,7 @@ if (( $# )); then # Set and remember offered tags. - comptags -i "$curcontext" "$@" + comptags "-i$prev" "$curcontext" "$@" # Sort the tags. @@ -80,11 +92,11 @@ if (( $# )); then # Return non-zero if at least one set of tags should be used. - comptags -T + comptags "-T$prev" return fi # The other mode: switch to the next set of tags. -comptags -N +comptags "-N$prev" diff --git a/Completion/Core/_wanted b/Completion/Core/_wanted index 1d6dcdb59..2303322d4 100644 --- a/Completion/Core/_wanted +++ b/Completion/Core/_wanted @@ -26,8 +26,8 @@ if [[ $# -gt 3 ]]; then return 1 fi elif [[ $# -gt 1 ]]; then - _tags "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" && + _tags -- "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" && _description "$gopt" "$@" else - _tags "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" + _tags -- "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" fi |