diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-09 13:14:59 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-09 13:14:59 +0000 |
commit | c615397157e5efd7a81c8ce11b3f77fd7ccb5a19 (patch) | |
tree | 9f6e9081024370574ae18b5808ebedf6d653d672 /Completion/Base/_describe | |
parent | 95af0ef9c4639763c8094d6e8cd5d8ec01a32f96 (diff) | |
download | zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.gz zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.xz zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.zip |
zsh-workers/8603
Diffstat (limited to 'Completion/Base/_describe')
-rw-r--r-- | Completion/Base/_describe | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Completion/Base/_describe b/Completion/Base/_describe index ddd35f0e7..41c2ba8e5 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -2,19 +2,16 @@ # This can be used to add options or values with descriptions as matches. -local cmd func opt expl tmps tmpd tmpmd tmpms ret=1 showd _nm hide -local tags type=value +local cmd opt expl tmps tmpd tmpmd tmpms ret=1 showd _nm hide +local type=value cmd="$words[1]" -func="$funcstack[2]" # Get the options. -while getopts 'oc:f:' opt; do +while getopts 'oc:' opt; do if [[ "$opt" = o ]]; then type=option - elif [[ "$opt" = f ]]; then - func="$OPTARG" else cmd="$OPTARG" fi @@ -23,9 +20,9 @@ shift OPTIND-1 # Do the tests. `showd' is set if the descriptions should be shown. -_tags -i -c "$cmd" -f "$func" "$type" || return 1 +_tags -c "$cmd" "$type" || return 1 -[[ "$tags" = *:${type}\[*describe*\]* ]] && showd=yes +_style "$type" describe && showd=yes _description expl "$1" shift @@ -36,7 +33,7 @@ else compdescribe -i "$@" fi -[[ "$type" = option && "$tags" = *:option\[*hide*\]* ]] && hide=yes +[[ "$type" = option ]] && _style option hide && hide=yes while compdescribe -g args tmpd tmpmd tmps tmpms; do |