Su : Add sudo for su -c.

This commit is contained in:
Dmitry Voronin 2024-03-11 21:47:51 +03:00
parent 2958eddb86
commit 3801872c05

View file

@ -2,10 +2,17 @@
# Root by default. # Root by default.
# Usage: s [USER] # Usage: s [USER]
function s() { function s() {
su - "${@}" su - "${1}"
}
# Run something as root.
# Usage: sudo <COMMAND>
function sudo() {
su -c "${*}"
} }
function _complete_s() { function _complete_s() {
_autocomplete "voronind" "dasha" _autocomplete "voronind" "dasha"
} }
complete -F _complete_s s complete -F _complete_s s
complete -F _autocomplete_nested sudo