feat: optional arguments

This commit is contained in:
iff 2023-08-01 17:41:41 +02:00
parent eb59cbde7f
commit 7a05ad56fc
5 changed files with 63 additions and 20 deletions

37
rules/privilege.toml Normal file
View file

@ -0,0 +1,37 @@
command = "privilege"
[[match_err]]
pattern = [
"as root",
"authentication is required",
"be root",
"be superuser",
"eacces",
"edspermissionerror",
"error: insufficient privileges",
"insufficient privileges",
"need root",
"non-root users cannot",
"not super-user",
"only root can",
"operation not permitted",
"permission denied",
"requires root",
"root privilege",
"root user",
"sudorequirederror",
"superuser privilege",
"unless you are root",
"updatedb: can not open a temporary file",
"use `sudo`",
"you don't have access to the history db.",
"you don't have write permissions",
]
suggest = [
'''
#[executable(sudo)]
sudo {{command}}''',
'''
#[executable(doas)]
doas {{command}}''',
]