mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Move setfacl completions to string
This commit is contained in:
parent
55a2945449
commit
3b0f9911e2
@ -7,19 +7,19 @@ function __fish_facl_list_spec_keyword
|
||||
end
|
||||
|
||||
function __fish_facl_starts_with_spec_user
|
||||
echo (commandline -ct) | __fish_sgrep -q -E 'u(ser)?:'
|
||||
commandline -ct | string match -r "u(ser)?:"
|
||||
end
|
||||
|
||||
function __fish_facl_starts_with_spec_group
|
||||
echo (commandline -ct) | __fish_sgrep -q -E 'g(roup)?:'
|
||||
commandline -ct | string match -r "g(roup)?:"
|
||||
end
|
||||
|
||||
function __fish_facl_extract_acl
|
||||
echo (commandline -ct) | __fish_sgrep -o -E '\w*:'
|
||||
commandline -ct | string replace -ar '.*(\w*:).*' '$1'
|
||||
end
|
||||
|
||||
complete -c setfacl -s m -s x -l modify -l remove -l set -n '__fish_facl_starts_with_spec_user' -a '(__fish_facl_extract_acl)(__fish_complete_users | sed "s/\t/:\t/g")'
|
||||
complete -c setfacl -s m -s x -l modify -l remove -l set -n '__fish_facl_starts_with_spec_group' -a '(__fish_facl_extract_acl)(__fish_complete_groups | sed "s/\t/:\t/g")'
|
||||
complete -c setfacl -s m -s x -l modify -l remove -l set -n '__fish_facl_starts_with_spec_user' -a '(__fish_facl_extract_acl)(__fish_complete_users | string replace -a "\t" ":\t")'
|
||||
complete -c setfacl -s m -s x -l modify -l remove -l set -n '__fish_facl_starts_with_spec_group' -a '(__fish_facl_extract_acl)(__fish_complete_groups | string replace -a "\t" ":\t")'
|
||||
complete -c setfacl -f -s m -s x -l modify -l remove -l set -a '(__fish_facl_list_spec_keyword)'
|
||||
|
||||
complete -c setfacl -s b -l remove-all --description 'Remove all extended ACL entries'
|
||||
|
Loading…
x
Reference in New Issue
Block a user