zsh-workers
 help / color / mirror / code / Atom feed
* [patch] sysctl update for OpenBSD
@ 2015-11-13  4:44 Matthew Martin
  2015-11-26  4:27 ` Matthew Martin
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Martin @ 2015-11-13  4:44 UTC (permalink / raw)
  To: zsh-workers

-w hasn't been a valid flag since 4.2 so it should be safe to just kill
it ;). The :# * bit in _cache_sysctlvars is because kern.version has
a newline in it's value.

- Matthew Martin


diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl
index ff3312f..9d9e8b9 100644
--- a/Completion/Unix/Command/_sysctl
+++ b/Completion/Unix/Command/_sysctl
@@ -34,13 +34,13 @@ case $OSTYPE in
       '(-n -p -a -A)*:sysctl variable:_files -W /proc/sys'
   ;;
   openbsd*)
-    : ${(A)_cache_sysctlvars:=${${(f)"$(sysctl -a)"}%% *}}
-    _arguments -s -A "-*" \
-      '(-w -A *)-a[list all string and integer variables]' \
-      '(-w -a *)-A[list all known variables]' \
-      '(-w)-n[show only values]' \
-      '(-a -A -n)-w[write variable]' \
-      '(-a -A)*:sysctl variable:_multi_parts ${words[(r)-w]:+-S=} -i . _cache_sysctlvars'
+    : ${(A)_cache_sysctlvars:=${${${(f)"$(sysctl -a 2>/dev/null)"}%%=*}:# *}}
+    _arguments -S -s -A "-*" \
+      '(-A -q *)-a[list all string and integer variables]' \
+      '(-a -q *)-A[list all known variables]' \
+      '-n[show only values]' \
+      '(-a -A)-q[suppress all output when setting a variable]' \
+      '(-a -A)*:sysctl variable:_multi_parts -i -S = -q . _cache_sysctlvars'
   ;;
   *)
     _default


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] sysctl update for OpenBSD
  2015-11-13  4:44 [patch] sysctl update for OpenBSD Matthew Martin
@ 2015-11-26  4:27 ` Matthew Martin
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Martin @ 2015-11-26  4:27 UTC (permalink / raw)
  To: zsh-workers

ping?

On Thu, Nov 12, 2015 at 10:44 PM, Matthew Martin <phy1729@gmail.com> wrote:
> -w hasn't been a valid flag since 4.2 so it should be safe to just kill
> it ;). The :# * bit in _cache_sysctlvars is because kern.version has
> a newline in it's value.
>
> - Matthew Martin
>
>
> diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl
> index ff3312f..9d9e8b9 100644
> --- a/Completion/Unix/Command/_sysctl
> +++ b/Completion/Unix/Command/_sysctl
> @@ -34,13 +34,13 @@ case $OSTYPE in
>        '(-n -p -a -A)*:sysctl variable:_files -W /proc/sys'
>    ;;
>    openbsd*)
> -    : ${(A)_cache_sysctlvars:=${${(f)"$(sysctl -a)"}%% *}}
> -    _arguments -s -A "-*" \
> -      '(-w -A *)-a[list all string and integer variables]' \
> -      '(-w -a *)-A[list all known variables]' \
> -      '(-w)-n[show only values]' \
> -      '(-a -A -n)-w[write variable]' \
> -      '(-a -A)*:sysctl variable:_multi_parts ${words[(r)-w]:+-S=} -i . _cache_sysctlvars'
> +    : ${(A)_cache_sysctlvars:=${${${(f)"$(sysctl -a 2>/dev/null)"}%%=*}:# *}}
> +    _arguments -S -s -A "-*" \
> +      '(-A -q *)-a[list all string and integer variables]' \
> +      '(-a -q *)-A[list all known variables]' \
> +      '-n[show only values]' \
> +      '(-a -A)-q[suppress all output when setting a variable]' \
> +      '(-a -A)*:sysctl variable:_multi_parts -i -S = -q . _cache_sysctlvars'
>    ;;
>    *)
>      _default


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-26  4:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13  4:44 [patch] sysctl update for OpenBSD Matthew Martin
2015-11-26  4:27 ` Matthew Martin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).