aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnettrace
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-11 18:51:02 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-14 16:52:49 -0300
commit15ad8696c7cf95059f163b4f7ed86ca697e8fe1e (patch)
tree7d61eb67b0ee8118d653917fb50f446d8e6c4f9d /src/fnettrace
parentStandardize usage string var declarations (diff)
downloadfirejail-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/fnettrace')
-rw-r--r--src/fnettrace/main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/fnettrace/main.c b/src/fnettrace/main.c
index 2f421562e..178ac3631 100644
--- a/src/fnettrace/main.c
+++ b/src/fnettrace/main.c
@@ -668,18 +668,20 @@ void logprintf(char *fmt, ...) {
668 va_end(args); 668 va_end(args);
669} 669}
670 670
671static const char *const usage_str =
672 "Usage: fnettrace [OPTIONS]\n"
673 "Options:\n"
674 " --help, -? - this help screen\n"
675 " --log=filename - netlocker logfile\n"
676 " --netfilter - build the firewall rules and commit them.\n"
677 " --tail - \"tail -f\" functionality\n"
678 "Examples:\n"
679 " # fnettrace - traffic trace\n"
680 " # fnettrace --netfilter --log=logfile - netlocker, dump output in logfile\n"
681 " # fnettrace --tail --log=logifile - similar to \"tail -f logfile\"\n";
682
671static void usage(void) { 683static void usage(void) {
672 printf("Usage: fnettrace [OPTIONS]\n"); 684 puts(usage_str);
673 printf("Options:\n");
674 printf(" --help, -? - this help screen\n");
675 printf(" --log=filename - netlocker logfile\n");
676 printf(" --netfilter - build the firewall rules and commit them.\n");
677 printf(" --tail - \"tail -f\" functionality\n");
678 printf("Examples:\n");
679 printf(" # fnettrace - traffic trace\n");
680 printf(" # fnettrace --netfilter --log=logfile - netlocker, dump output in logfile\n");
681 printf(" # fnettrace --tail --log=logifile - similar to \"tail -f logfile\"\n");
682 printf("\n");
683} 685}
684 686
685int main(int argc, char **argv) { 687int main(int argc, char **argv) {