-
Notifications
You must be signed in to change notification settings - Fork 17
/
setfacl.sh
36 lines (29 loc) · 880 Bytes
/
setfacl.sh
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
_patch_help() {
$@ --help | sed '/^Usage:/ s/{ -.* }//'
}
_patch_table() {
_patch_table_add_metadata combine-shorts | \
_patch_table_edit_options \
'--modify;[`_choice_acl`]' \
'--remove;[`_choice_acl`]' \
'--set;[`_choice_acl`]' \
}
_choice_acl() {
_argc_util_mode_parts ':'
if [[ "$argc__parts_len" -lt 2 ]]; then
printf "%s:\0\n" u g m o
elif [[ "$argc__parts_len" -eq 2 ]]; then
if [[ "${argc__parts_values[0]}" == "u" ]]; then
_module_os_user | _argc_util_transform suffix=: nospace
elif [[ "${argc__parts_values[0]}" == "g" ]]; then
_module_os_group | _argc_util_transform suffix=: nospace
else
_choice_perm
fi
elif [[ "$argc__parts_len" -eq 3 ]]; then
_choice_perm
fi
}
_choice_perm() {
printf "%s\n" r w x rw rx wx rwx
}