facf0c92e0
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
37 lines
803 B
Plaintext
37 lines
803 B
Plaintext
#compdef pfexec
|
|
|
|
# This is a _values-like function that completes privileges and !-prefixed
|
|
# privileges, comma-separated, and unique.
|
|
_privset() {
|
|
local expl p
|
|
local -a privs
|
|
|
|
privs=( ${(f)"$(ppriv -l)"} all none zone basic )
|
|
|
|
# Ignore existing values
|
|
compset -P '*,'
|
|
# Ignore a leading !, maybe backslash-quoted
|
|
compset -P '\\#!'
|
|
|
|
# Remove already-referenced privs
|
|
for p in ${(s:,:)${IPREFIX//\\#\!/}}; do
|
|
privs=( ${privs:#$p} )
|
|
done
|
|
|
|
_wanted privs expl 'privilege' compadd -qS , -a privs
|
|
}
|
|
|
|
_pfexec() {
|
|
local cmd cpp
|
|
local -a _comp_priv_prefix
|
|
local -A opt_args
|
|
cmd="$words[1]"
|
|
cpp='_comp_priv_prefix=( $cmd ${(kv)opt_args[(I)-P]} )'
|
|
_arguments \
|
|
'-P+[privileges to acquire]:privspec:_privset' \
|
|
"(-): :{ $cpp; _command_names -e }" \
|
|
"*:: :{ $cpp; _normal }"
|
|
}
|
|
|
|
_pfexec "$@"
|