Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _sysctl pattern fails for FreeBSD 10
- X-seq: zsh-workers 33315
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: _sysctl pattern fails for FreeBSD 10
- Date: Thu, 02 Oct 2014 00:46:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1412203605; bh=e8Feeh1A/VXpreUh4sdnOmwKObCTQOsH2v5ssBV3iv4=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=GNlidEmYxr2w7u5kn4v2Y/TOVRVKGmeu97uL9xuPsTrP/eLf893RZUmEreRIK/Xk/NUqHIg62JbiMHdlUs3wk8oLfa1imQJYs4ZB+KUI/VJwZlg7lBhR1UCNrE2C1RoUObXLicAfuspDiK/SGwipyTj9bYwiLwGtK5RXyRd96+4=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author