2001-07-03 16:32:12 +02:00
|
|
|
#compdef sysctl
|
|
|
|
|
|
|
|
case $OSTYPE in
|
2001-07-06 13:22:13 +02:00
|
|
|
freebsd[0-4].*)
|
|
|
|
: ${(A)_cache_sysctlvars:=${${$(sysctl -A):#[^a-z]*}%%:*}}
|
|
|
|
_arguments -s -A "-*" \
|
|
|
|
'(-w -X *)-a[list all]' \
|
|
|
|
'(-w -X *)-A[show all opaques (values suppressed)]' \
|
|
|
|
'(-w)-b[binary output]' \
|
|
|
|
'(-w)-n[show only variable values]' \
|
|
|
|
'(-a -A -b -n -X)-w[write mode]' \
|
|
|
|
'(-a -A -w *)-X[show all opaques (entire values)]' \
|
|
|
|
'(-a -A -X)*:sysctl variable:_multi_parts ${words[(r)-w]:+-S=} -i . _cache_sysctlvars'
|
2001-07-03 16:32:12 +02:00
|
|
|
;;
|
2001-07-06 13:22:13 +02:00
|
|
|
freebsd[5-9].*)
|
|
|
|
local -a sysctlvars
|
|
|
|
sysctlvars=( $(sysctl -aN) )
|
|
|
|
_arguments -s -A "-*" \
|
|
|
|
'(*)-a[list all]' \
|
2001-07-03 16:32:12 +02:00
|
|
|
'-b[binary output]' \
|
2001-07-06 13:22:13 +02:00
|
|
|
'(-n)-N[show only variable names]' \
|
|
|
|
'(-N)-n[show only variable values]' \
|
|
|
|
'(-x)-o[show opaques as well (values suppressed)]' \
|
|
|
|
'(-o)-x[show opaques as well (entire values)]' \
|
|
|
|
'(-a)*:sysctl variable:_multi_parts -i . sysctlvars'
|
2001-07-03 16:32:12 +02:00
|
|
|
;;
|
|
|
|
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
|