Debian Codegraph @

src/sudo/cli/help.rs

raw symbols SCIP
1 pub fn usage_msg() -> &'static str {
2 xlat!(
3 "\
4 usage: sudo -h | -K | -k | -V
5 usage: sudo [-ABbknS] [-p prompt] [-D directory] [-g group] [-u user] [-i | -s] [command [arg ...]]
6 usage: sudo -v [-ABknS] [-p prompt] [-g group] [-u user]
7 usage: sudo -l [-ABknS] [-p prompt] [-U user] [-g group] [-u user] [command [arg ...]]
8 usage: sudo -e [-ABknS] [-p prompt] [-D directory] [-g group] [-u user] file ..."
9 )
10 }
11
12 fn descriptor() -> &'static str {
13 xlat!("sudo - run commands as another user")
14 }
15
16 fn help_msg() -> &'static str {
17 xlat!("Options:
18 -A, --askpass use a helper program for password prompting
19 -b, --background run command in the background
20 -B, --bell ring bell when prompting
21 -D, --chdir=directory change the working directory before running command
22 -e, --edit edit files instead of running a command
23 -g, --group=group run command as the specified group name or ID
24 -h, --help display help message and exit
25 -i, --login run login shell as the target user; a command may also be specified
26 -K, --remove-timestamp remove timestamp file completely
27 -k, --reset-timestamp invalidate timestamp file
28 -l, --list list user's privileges or check a specific command; use twice for longer format
29 -n, --non-interactive non-interactive mode, no prompts are used
30 -p, --prompt=prompt use the specified password prompt
31 -S, --stdin read password from standard input
32 -s, --shell run shell as the target user; a command may also be specified
33 -U, --other-user=user in list mode, display privileges for user
34 -u, --user=user run command (or edit file) as specified user name or ID
35 -V, --version display version information and exit
36 -v, --validate update user's timestamp without running a command
37 --preserve-env=list preserve specific environment variables
38 -- stop processing command line arguments")
39 }
40
41 pub fn long_help_message() -> String {
42 format!("{}\n{}\n{}", descriptor(), usage_msg(), help_msg())
43 }