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/fnet | |
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/fnet')
-rw-r--r-- | src/fnet/main.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/fnet/main.c b/src/fnet/main.c index fc36ae977..d1c8170ca 100644 --- a/src/fnet/main.c +++ b/src/fnet/main.c | |||
@@ -35,19 +35,21 @@ void fmessage(char* fmt, ...) { // TODO: this function is duplicated in src/fire | |||
35 | fflush(0); | 35 | fflush(0); |
36 | } | 36 | } |
37 | 37 | ||
38 | static const char *const usage_str = | ||
39 | "Usage:\n" | ||
40 | "\tfnet create veth dev1 dev2 bridge child\n" | ||
41 | "\tfnet create macvlan dev parent child\n" | ||
42 | "\tfnet moveif dev proc\n" | ||
43 | "\tfnet printif\n" | ||
44 | "\tfnet printif scan\n" | ||
45 | "\tfnet config interface dev ip mask mtu\n" | ||
46 | "\tfnet config mac addr\n" | ||
47 | "\tfnet config ipv6 dev ip\n" | ||
48 | "\tfnet ifup dev\n" | ||
49 | "\tfnet waitll dev\n"; | ||
38 | 50 | ||
39 | static void usage(void) { | 51 | static void usage(void) { |
40 | printf("Usage:\n"); | 52 | puts(usage_str); |
41 | printf("\tfnet create veth dev1 dev2 bridge child\n"); | ||
42 | printf("\tfnet create macvlan dev parent child\n"); | ||
43 | printf("\tfnet moveif dev proc\n"); | ||
44 | printf("\tfnet printif\n"); | ||
45 | printf("\tfnet printif scan\n"); | ||
46 | printf("\tfnet config interface dev ip mask mtu\n"); | ||
47 | printf("\tfnet config mac addr\n"); | ||
48 | printf("\tfnet config ipv6 dev ip\n"); | ||
49 | printf("\tfnet ifup dev\n"); | ||
50 | printf("\tfnet waitll dev\n"); | ||
51 | } | 53 | } |
52 | 54 | ||
53 | int main(int argc, char **argv) { | 55 | int main(int argc, char **argv) { |