about summary refs log tree commit diff
path: root/Completion/Unix/Command/_sysctl
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-07-03 14:32:12 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-07-03 14:32:12 +0000
commite390c96bd667c442a6fc4e2f8f315a141a4c6a51 (patch)
tree1f141bae1668f3c37d8a0804f60332167642f1e0 /Completion/Unix/Command/_sysctl
parentad57c03213b3d163bcad7914fd0c7ec10e583d5d (diff)
downloadzsh-e390c96bd667c442a6fc4e2f8f315a141a4c6a51.tar.gz
zsh-e390c96bd667c442a6fc4e2f8f315a141a4c6a51.tar.xz
zsh-e390c96bd667c442a6fc4e2f8f315a141a4c6a51.zip
add completion for sysctl(8) (15215, 15223)
Diffstat (limited to 'Completion/Unix/Command/_sysctl')
-rw-r--r--Completion/Unix/Command/_sysctl33
1 files changed, 33 insertions, 0 deletions
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