From 05e37bd994a04874215c5e02bbfd43599c512c63 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sun, 8 May 2016 00:09:16 +0200 Subject: 38420: _baudrates: Make style lookups fit better with the rest of compsys To quote Oliver Kiddle: > The original concept with styles was that style's could have fairly > generic names because the context allows you to select the detailed > context. So perhaps consider allowing this to work as, for example: > zstyle ':completion:*:*:screen:*:baud-rates' max-value 9600 --- ChangeLog | 3 +++ Completion/Unix/Type/_baudrates | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d65826878..9ddab6da6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ * 38425: Completion/BSD/Command/_cu: _cu: Remove old -d option of _baudrates + * 38420: Completion/Unix/Type/_baudrates: _baudrates: Make style + lookups fit better with the rest of compsys + 2016-05-06 Daniel Shahaf * 38401: Completion/Debian/Type/_deb_packages: New completion diff --git a/Completion/Unix/Type/_baudrates b/Completion/Unix/Type/_baudrates index d0ba1650a..add359d13 100644 --- a/Completion/Unix/Type/_baudrates +++ b/Completion/Unix/Type/_baudrates @@ -23,9 +23,9 @@ # It is also possible to override the arguments to -f, -u and -l via styles in # a similar fashion: # -# zstyle ':completion:*:*:screen:*' max-baud-rate 9600 -# zstyle ':completion:*:*:screen:*' min-baud-rate 1200 -# zstyle ':completion:*:*:screen:*' baud-rate-filter some_function_name +# zstyle ':completion:*:*:screen:*:baud-rates' max-value 9600 +# zstyle ':completion:*:*:screen:*:baud-rates' min-value 1200 +# zstyle ':completion:*:*:screen:*:baud-rates' filter some_function_name local tmp local -a expl rates @@ -53,9 +53,9 @@ zstyle -a ":completion:${curcontext}:" baud-rates rates || 115200 230400 460800 500000 576000 921600 1000000 1152000 1500000 2000000 2500000 3000000 3500000 4000000 ) -zstyle -s ":completion:${curcontext}:" max-baud-rate tmp && opts[-u]=$tmp -zstyle -s ":completion:${curcontext}:" min-baud-rate tmp && opts[-l]=$tmp -zstyle -s ":completion:${curcontext}:" baud-rate-filter tmp && opts[-f]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" max-value tmp && opts[-u]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" min-value tmp && opts[-l]=$tmp +zstyle -s ":completion:${curcontext}:baud-rates" filter tmp && opts[-f]=$tmp if (( ${+opts[-u]} )) || (( ${+opts[-l]} )); then local -i min max -- cgit 1.4.1