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
|
# (C) 2024 Danie
# Completion script for the "doas" command.
# Supports opendoas
function completion/doas {
typeset OPTIONS ARGOPT PREFIX
OPTIONS=( #>#
"C:; parse and check the configuration file"
"L; clear any persisted authentications"
"n; non-interactive mode"
"s; execute shell from SHELL or /etc/passwd"
"u:; execute the command as user"
) #<#
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(C)
complete -P "$PREFIX" -f
;;
(u)
complete -P "$PREFIX" -u
;;
('')
command -f completion//getoperands
command -f completion//reexecute
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 et:
|