about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/.distfiles18
-rw-r--r--Completion/Unix/Command/_sysctl33
3 files changed, 57 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 903c91fd4..6f57ef18c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-03  Oliver Kiddle  <opk@zsh.org>
+
+	* 15223, Akinori Musha: 15215: Completion/Unix/Command/.distfiles,
+	Completion/Unix/Command/_sysctl: Add completion for sysctl(8)
+
 2001-07-02  Bart Schaefer  <schaefer@zsh.org>
 
 	* unposted: zshconfig.ac: Remove references to FUNCINST_MK.
@@ -5,7 +10,7 @@
 2001-07-02  Oliver Kiddle  <opk@zsh.org>
 
 	* 15204: zshconfig.ac, Src/compat.c, Src/params.c: fix compilation
-	problems on IRIX 5.2 and correct error messages
+	problems on IRIX 5.3 and correct error messages
 
 2001-06-30  Bart Schaefer  <schaefer@zsh.org>
 
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
new file mode 100644
index 000000000..dbab4a8fb
--- /dev/null
+++ b/Completion/Unix/Command/.distfiles
@@ -0,0 +1,18 @@
+DISTFILES_SRC='
+.distfiles
+_a2ps         _dvi          _gzip         _man          _rcs          _w3m
+_apachectl    _enscript     _iconv        _mh           _rlogin       _webbrowser
+_archie       _fakeroot     _imagemagick  _mount        _sh           _wget
+_arp          _fetchmail    _init_d       _mutt         _slrn         _whereis
+_bison        _find         _ispell       _mysql_utils  _socket       _whois
+_bzip2        _finger       _java         _ncftp        _ssh          _xargs
+_chown        _flex         _joe          _nslookup     _strip        _yodl
+_compress     _gcc          _killall      _pack         _stty         _yp
+_configure    _gdb          _look         _patch        _su           _zcat
+_cpio         _getconf      _lp           _pbm          _sudo         _zdump
+_cvs          _gnu_generic  _ls           _perl         _tar          _zip
+_dd           _gprof        _lynx         _perldoc      _telnet       _pine
+_dict         _grep         _lzop         _prcs         _tiff         _elm
+_diff         _gs           _make         _psutils      _tin	_apm  _mail
+_loadkeys     _modutils     _ruby         _sysctl
+'
diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl
new file mode 100644
index 000000000..4a2eaaf87
--- /dev/null
+++ b/Completion/Unix/Command/_sysctl
@@ -0,0 +1,33 @@
+#compdef sysctl
+
+case $OSTYPE in
+  freebsd[0-4]*)
+    _arguments -s \
+      '-a[list all]' \
+      '-A[show all opaques (values suppressed)]' \
+      '-b[binary output]' \
+      '-n[show only variable values]' \
+      '-w[write mode]' \
+      '-X[show all opaques (entire values)]' \
+      "*:sysctl variable:compadd ${words[(r)-w]:+-S =} $(sysctl -A | sed 's/:.*//')"
+  ;;
+  freebsd[5-9]*)
+    _arguments -s \
+      '-a[list all]' \
+      '-b[binary output]' \
+      '-N[show only variable names]' \
+      '-n[show only variable values]' \
+      '-o[show opaques as well (values suppressed)]' \
+      '-x[show opaques as well (entire values)]' \
+      '*:sysctl variable:compadd -S "" - $(sysctl -aN)'
+  ;;
+  linux*)
+    _arguments -A "-*" \
+      '-n[show only variable values]' \
+      '(-n -p -a -A)-w[write mode]' \
+      '(-n -w -a -A *)-p[specify file to load sysctl settings from]:file:_files' \
+      '(-n -w -p -A *)-a[list all]' \
+      '(-n -w -p -a *)-A[list all in table form]' \
+      '(-n -p -a -A)*:sysctl variable:_files -W /proc/sys'
+  ;;
+esac