zsh-workers
 help / color / mirror / code / Atom feed
42fdc2bd006cfd64ed6fa5db20d005a9f74ab227 blob 1027 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
#compdef kldload kldunload

(( $+functions[_kld_module] )) ||
_kld_module() {
  local ret=1

  compadd "$@" - /boot/{kernel,modules}/*.ko(-.:t) && ret=0
  _files "$@" -g '*.ko(-.)' && ret=0

  return ret
}

(( $+functions[_kld_unload] )) ||
_kld_unload() {
  compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $5 }' )
}

(( $+functions[_kld_unload_id] )) ||
_kld_unload_id() {
  compadd "$@" - $( /sbin/kldstat | awk '($1 ~ /^[0-9]/) { print $1 }' )
}

_kld() {
  unset _cache_sysctlvars

  case "$service" in
    kldload)
      _arguments -s -S -A "-*" \
        "-n[don't try to load module if already loaded]" \
        '-v[be verbose]' \
        '-q[silence any extraneous warnings]' \
        '*:module to load:_kld_module'
    ;;

    kldunload)
      _arguments -s -S -A "-*" \
        '-f[force the unload]' \
        '-v[be verbose]' \
        '(-n)-i:module id to unload:_kld_unload_id' \
        '(-i)-n:module to unload:_kld_unload' \
        '*:module to unload:_kld_unload'
    ;;
  esac
}

_kld "$@"
debug log:

solving 42fdc2bd0 ...
found 42fdc2bd0 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).