zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _sysctl pattern fails for FreeBSD 10
@ 2014-10-01 22:46 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2014-10-01 22:46 UTC (permalink / raw)
  To: Zsh workers

With FreeBSD 10.x, $OSTYPE doesn't match the [5-9] part any more.
Also, it seems wise to fall back on default completion if we can't do
better. There's a lot of newer options that aren't completed but this
doesn't fix that.

Oliver

diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl
index 36b579b..ff3312f 100644
--- a/Completion/Unix/Command/_sysctl
+++ b/Completion/Unix/Command/_sysctl
@@ -1,9 +1,9 @@
 #compdef sysctl
 
 case $OSTYPE in
-  *freebsd[5-9].*|freebsd4.[4-9]*)
+  *freebsd<5->.*|freebsd4.[4-9]*)
     local -a sysctlvars
-    sysctlvars=( $(sysctl -aN) )
+    sysctlvars=( $(_call_program sysctl-variables sysctl -aN) )
     _arguments -s -A "-*" \
       '(*)-a[list all]' \
       '-b[binary output]' \
@@ -41,5 +41,8 @@ case $OSTYPE in
       '(-w)-n[show only values]' \
       '(-a -A -n)-w[write variable]' \
       '(-a -A)*:sysctl variable:_multi_parts ${words[(r)-w]:+-S=} -i . _cache_sysctlvars'
-    ;;
+  ;;
+  *)
+    _default
+  ;;
 esac


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-01 22:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 22:46 PATCH: _sysctl pattern fails for FreeBSD 10 Oliver Kiddle

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).