diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-05-11 18:51:02 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-05-14 16:52:49 -0300 |
commit | 15ad8696c7cf95059f163b4f7ed86ca697e8fe1e (patch) | |
tree | 7d61eb67b0ee8118d653917fb50f446d8e6c4f9d /src/profstats/main.c | |
parent | Standardize usage string var declarations (diff) | |
download | firejail-15ad8696c7cf95059f163b4f7ed86ca697e8fe1e.tar.gz firejail-15ad8696c7cf95059f163b4f7ed86ca697e8fe1e.tar.zst firejail-15ad8696c7cf95059f163b4f7ed86ca697e8fe1e.zip |
Move usage text into usage_str var
For consistency and readability.
Note: This also makes exactly one extra blank line be printed at the end
of every usage text, which is currently only done in the following
files:
* src/fcopy/main.c
* src/fnettrace-dns/main.c
* src/fnettrace-icmp/main.c
* src/fnettrace-sni/main.c
* src/fnettrace/main.c
* src/profstats/main.c
Diffstat (limited to 'src/profstats/main.c')
-rw-r--r-- | src/profstats/main.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/profstats/main.c b/src/profstats/main.c index d5e57e7cc..49ed1637a 100644 --- a/src/profstats/main.c +++ b/src/profstats/main.c | |||
@@ -74,32 +74,34 @@ static int arg_restrict_namespaces = 0; | |||
74 | 74 | ||
75 | static char *profile = NULL; | 75 | static char *profile = NULL; |
76 | 76 | ||
77 | static const char *const usage_str = | ||
78 | "profstats - print profile statistics\n" | ||
79 | "Usage: profstats [options] file[s]\n" | ||
80 | "Options:\n" | ||
81 | " --apparmor - print profiles without apparmor\n" | ||
82 | " --caps - print profiles without caps\n" | ||
83 | " --dbus-system-none - print profiles without \"dbus-system none\"\n" | ||
84 | " --dbus-user-none - print profiles without \"dbus-user none\"\n" | ||
85 | " --ssh - print profiles without \"include disable-common.inc\"\n" | ||
86 | " --noexec - print profiles without \"include disable-exec.inc\"\n" | ||
87 | " --noroot - print profiles without \"noroot\"\n" | ||
88 | " --private-bin - print profiles without private-bin\n" | ||
89 | " --private-dev - print profiles without private-dev\n" | ||
90 | " --private-etc - print profiles without private-etc\n" | ||
91 | " --private-tmp - print profiles without private-tmp\n" | ||
92 | " --print-blacklist - print all --blacklist for a profile\n" | ||
93 | " --print-whitelist - print all --private and --whitelist for a profile\n" | ||
94 | " --seccomp - print profiles without seccomp\n" | ||
95 | " --memory-deny-write-execute - print profiles without \"memory-deny-write-execute\"\n" | ||
96 | " --restrict-namespaces - print profiles without \"restrict-namespaces\"\n" | ||
97 | " --whitelist-home - print profiles whitelisting home directory\n" | ||
98 | " --whitelist-var - print profiles without \"include whitelist-var-common.inc\"\n" | ||
99 | " --whitelist-runuser - print profiles without \"include whitelist-runuser-common.inc\" or \"blacklist ${RUNUSER}\"\n" | ||
100 | " --whitelist-usrshare - print profiles without \"include whitelist-usr-share-common.inc\"\n" | ||
101 | " --debug\n"; | ||
102 | |||
77 | static void usage(void) { | 103 | static void usage(void) { |
78 | printf("profstats - print profile statistics\n"); | 104 | puts(usage_str); |
79 | printf("Usage: profstats [options] file[s]\n"); | ||
80 | printf("Options:\n"); | ||
81 | printf(" --apparmor - print profiles without apparmor\n"); | ||
82 | printf(" --caps - print profiles without caps\n"); | ||
83 | printf(" --dbus-system-none - print profiles without \"dbus-system none\"\n"); | ||
84 | printf(" --dbus-user-none - print profiles without \"dbus-user none\"\n"); | ||
85 | printf(" --ssh - print profiles without \"include disable-common.inc\"\n"); | ||
86 | printf(" --noexec - print profiles without \"include disable-exec.inc\"\n"); | ||
87 | printf(" --noroot - print profiles without \"noroot\"\n"); | ||
88 | printf(" --private-bin - print profiles without private-bin\n"); | ||
89 | printf(" --private-dev - print profiles without private-dev\n"); | ||
90 | printf(" --private-etc - print profiles without private-etc\n"); | ||
91 | printf(" --private-tmp - print profiles without private-tmp\n"); | ||
92 | printf(" --print-blacklist - print all --blacklist for a profile\n"); | ||
93 | printf(" --print-whitelist - print all --private and --whitelist for a profile\n"); | ||
94 | printf(" --seccomp - print profiles without seccomp\n"); | ||
95 | printf(" --memory-deny-write-execute - print profiles without \"memory-deny-write-execute\"\n"); | ||
96 | printf(" --restrict-namespaces - print profiles without \"restrict-namespaces\"\n"); | ||
97 | printf(" --whitelist-home - print profiles whitelisting home directory\n"); | ||
98 | printf(" --whitelist-var - print profiles without \"include whitelist-var-common.inc\"\n"); | ||
99 | printf(" --whitelist-runuser - print profiles without \"include whitelist-runuser-common.inc\" or \"blacklist ${RUNUSER}\"\n"); | ||
100 | printf(" --whitelist-usrshare - print profiles without \"include whitelist-usr-share-common.inc\"\n"); | ||
101 | printf(" --debug\n"); | ||
102 | printf("\n"); | ||
103 | } | 105 | } |
104 | 106 | ||
105 | static void process_file(char *fname) { | 107 | static void process_file(char *fname) { |