1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-11 20:31:11 +01:00

add exclusion lists and use _multi_parts for sysctl completion on BSD (15252)

This commit is contained in:
Oliver Kiddle 2001-07-06 11:22:13 +00:00
parent f2040baa9b
commit 1348458447
3 changed files with 28 additions and 19 deletions

View file

@ -1,3 +1,9 @@
2001-07-06 Oliver Kiddle <opk@zsh.org>
* 15252 (and Akinori Musha: 15245): Completion/BSD/Command/_kld,
Completion/Unix/Command/_sysctl: Add exclusion lists and use
_multi_parts for BSD completion of sysctl.
2001-07-06 Sven Wischnowsky <wischnow@zsh.org>
* 15283: Completion/Unix/Type/_path_files: when looking for
@ -53,8 +59,6 @@
AC_SEARCH_LIBS for pcre. Have pcre_match set positional
parameters with the contents of capture buffers.
2001-07-03 Clint Adams <clint@zsh.org>
* unposted: Doc/Makefile.in: add mod_pcre.yo to makefile.
2001-07-03 Oliver Kiddle <opk@zsh.org>

View file

@ -21,6 +21,8 @@ _kld_unload_id() {
}
_kld() {
unset _cache_sysctlvars
case "$service" in
kldload)
_arguments -s \

View file

@ -1,25 +1,28 @@
#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[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'
;;
freebsd[5-9]*)
_arguments -s \
'-a[list all]' \
freebsd[5-9].*)
local -a sysctlvars
sysctlvars=( $(sysctl -aN) )
_arguments -s -A "-*" \
'(*)-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)'
'(-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'
;;
linux*)
_arguments -A "-*" \