about summary refs log tree commit diff
path: root/Completion/BSD/Command/_jexec
blob: f065ea1e0aef3dc0e560f871b637def9ef376da0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#compdef jexec

_jexec_normal() {
  local PATH=$PATH
  # relative paths are relative to the jail's root
  path=( "$(command jls -j $words[1] path)"/$^path )
  shift 1 words; (( CURRENT-- ))
  _normal
}

_jexec() {
  _arguments -s -w -A "-*" : \
    '(-U)-u[host environment user whom command runs as]:host user:_users' \
    '(-u)-U[jail environment user whom command runs as]:jail user:_users' \
    '1:jail:_jails' \
    '*:: : _jexec_normal'
}

_jexec "$@"