zsh-workers
 help / color / mirror / code / Atom feed
fbe4c9363c933f9c2ada6a69e7a301f68bafdeb7 blob 862 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
 
#autoload

# Provides completion for file modes (formerly part of _chmod)

local curcontext=$curcontext
local -a context line state state_descr copts=( "${@}" ) privs
local -A val_args

privs=(
  'r[read]' 'w[write]' 'x[execute]'
  's[set uid/gid]' 't[sticky]'
  'X[execute only if directory or executable to another]'
  "u[owner's current permissions]"
  "g[group's current permissions]"
  "o[others' current permissions]"
)

[[ $OSTYPE == solaris* ]] &&
privs+=( 'l[mandatory locking]' )

compset -P '*,'
compset -S ',*'

if [[ -prefix [0-7] ]]; then
  _message -e number 'numeric mode'
elif compset -P '[a-z]#[+-=]'; then
  _values -O copts -S '' privilege $privs && return 0
else
  compset -P '*'
  copts=( -S '' )
  _alternative -O copts \
    'who:who:((a\:all u\:owner g\:group o\:others))' \
    'operators:operator:(+ - =)' \
  && return 0
fi

return 1
debug log:

solving fbe4c9363 ...
found fbe4c9363 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).