]> git.puffer.fish Git - matthieu/frr.git/commitdiff
watchquagga: break excessively long help string
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 3 Mar 2015 07:57:25 +0000 (08:57 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:29 +0000 (15:33 +0000)
watchquagga's command line help string exceeds the ISO C maximum string
length (4095 characters).  Just break it in two.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 33b9663a89b5ec319986de0673764d2a18ec8725)

watchquagga/watchquagga.c

index 36c8338210e369aab286985af8152b2af578f118..5cb224a45ab2530add57bd3f2f4eb7fcf35b6c39 100644 (file)
@@ -216,7 +216,8 @@ usage(const char *progname, int status)
   if (status != 0)
     fprintf(stderr, "Try `%s --help' for more information.\n", progname);
   else
-    printf("Usage : %s [OPTION...] <daemon name> ...\n\n\
+    {
+      printf("Usage : %s [OPTION...] <daemon name> ...\n\n\
 Watchdog program to monitor status of quagga daemons and try to restart\n\
 them if they are down or unresponsive.  It determines whether a daemon is\n\
 up based on whether it can connect to the daemon's vty unix stream socket.\n\
@@ -260,8 +261,12 @@ the -m and -M options allow you to control the minimum delay between\n\
 restart commands.  The minimum restart delay is recalculated each time\n\
 a restart is attempted: if the time since the last restart attempt exceeds\n\
 twice the -M value, then the restart delay is set to the -m value.\n\
-Otherwise, the interval is doubled (but capped at the -M value).\n\n\
-Options:\n\
+Otherwise, the interval is doubled (but capped at the -M value).\n\n",
+        progname,mode_str[0],progname,mode_str[1],progname,mode_str[2],
+        progname,mode_str[3],progname,mode_str[4],progname,mode_str[2],
+        mode_str[3]);
+
+      printf("Options:\n\
 -d, --daemon   Run in daemon mode.  In this mode, error messages are sent\n\
                to syslog instead of stdout.\n\
 -S, --statedir Set the vty socket directory (default is %s)\n\
@@ -319,12 +324,12 @@ Options:\n\
                it with a space.  This is an ugly hack to circumvent problems\n\
                passing command-line arguments with embedded spaces.\n\
 -v, --version  Print program version\n\
--h, --help     Display this help and exit\n\
-", progname,mode_str[0],progname,mode_str[1],progname,mode_str[2],
-progname,mode_str[3],progname,mode_str[4],progname,mode_str[2],mode_str[3],
-VTYDIR,DEFAULT_LOGLEVEL,LOG_EMERG,LOG_DEBUG,LOG_DEBUG,
-DEFAULT_MIN_RESTART,DEFAULT_MAX_RESTART,
-DEFAULT_PERIOD,DEFAULT_TIMEOUT,DEFAULT_RESTART_TIMEOUT,DEFAULT_PIDFILE);
+-h, --help     Display this help and exit\n",
+        VTYDIR,DEFAULT_LOGLEVEL,LOG_EMERG,LOG_DEBUG,LOG_DEBUG,
+        DEFAULT_MIN_RESTART,DEFAULT_MAX_RESTART,
+        DEFAULT_PERIOD,DEFAULT_TIMEOUT,DEFAULT_RESTART_TIMEOUT,
+        DEFAULT_PIDFILE);
+    }
 
   return status;
 }