about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorFrank Terbeck <ft@bewatermyfriend.org>2016-05-08 00:09:14 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2016-05-09 03:40:31 +0200
commit6f3fbcc67ab8f5799b4776aebd0525cf580cbd1f (patch)
tree88ec55c849f0be5f7aac3d1815f8519887dcd222 /Completion
parent795b285ce8b8e8baf26272f2c7c459334bca5f9d (diff)
downloadzsh-6f3fbcc67ab8f5799b4776aebd0525cf580cbd1f.tar.gz
zsh-6f3fbcc67ab8f5799b4776aebd0525cf580cbd1f.tar.xz
zsh-6f3fbcc67ab8f5799b4776aebd0525cf580cbd1f.zip
38421: _baudrates: Fit better into the general completion framework
This should work better in concert with other helpers and builtins of
the completion system by accepting arguments that would be handed to
compadd.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_baudrates16
1 files changed, 5 insertions, 11 deletions
diff --git a/Completion/Unix/Type/_baudrates b/Completion/Unix/Type/_baudrates
index 35e55ad09..d0ba1650a 100644
--- a/Completion/Unix/Type/_baudrates
+++ b/Completion/Unix/Type/_baudrates
@@ -15,10 +15,6 @@
 #                  value in the complete list to generate an arbitrary
 #                  sub-set.
 #
-#     -t TAG       Use TAG as the tag value in _wanted call.
-#
-#     -d DESC      Use DESC as the description value in _wanted call.
-#
 # The default complete list of available baud rates is also configurable via
 # the 'baud-rates' style:
 #
@@ -31,11 +27,11 @@
 #   zstyle ':completion:*:*:screen:*' min-baud-rate 1200
 #   zstyle ':completion:*:*:screen:*' baud-rate-filter some_function_name
 
+local tmp
+local -a expl rates
 local -A opts
-local expl tag desc tmp
-local -a rates
 
-zparseopts -E -A opts u: l: f: d: t:
+zparseopts -E -A opts u: l: f:
 
 # The following uses a generated list; first find out where the B* macros are
 # defined:
@@ -76,9 +72,7 @@ if (( ${+opts[-f]} )); then
   done
 fi
 
-tag=${opts[-t]:-baud-rate}
-desc=${opts[-d]:-baud rate}
-
 # -1V removes dupes (which there shouldn't be) and otherwise leaves the
 # order in the $rates array intact.
-_wanted -1V $tag expl $desc compadd -a $expl -- rates
+_description -1V baud-rates expl 'baud rate'
+compadd "${(@)argv/#-J/-V}" "$expl[@]" -- "${rates[@]}"