ctdb: Use C99 initializer for poptOption in ctdb tool
authorAndreas Schneider <asn@samba.org>
Tue, 8 Jan 2019 10:59:31 +0000 (11:59 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:12 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
ctdb/tools/ctdb.c

index ee64566ba0459af9510614e043c83a802a23d9d8..bef9c5f97fb8dbce3e55caba8c314ee350454132 100644 (file)
@@ -6068,22 +6068,70 @@ static void usage(const char *command)
 
 struct poptOption cmdline_options[] = {
        POPT_AUTOHELP
-       { "debug", 'd', POPT_ARG_STRING, &options.debuglevelstr, 0,
-               "debug level"},
-       { "timelimit", 't', POPT_ARG_INT, &options.timelimit, 0,
-               "timelimit (in seconds)" },
-       { "node", 'n', POPT_ARG_INT, &options.pnn, 0,
-               "node specification - integer" },
-       { NULL, 'Y', POPT_ARG_NONE, &options.machinereadable, 0,
-               "enable machine readable output", NULL },
-       { "separator", 'x', POPT_ARG_STRING, &options.sep, 0,
-               "specify separator for machine readable output", "CHAR" },
-       { NULL, 'X', POPT_ARG_NONE, &options.machineparsable, 0,
-               "enable machine parsable output with separator |", NULL },
-       { "verbose", 'v', POPT_ARG_NONE, &options.verbose, 0,
-               "enable verbose output", NULL },
-       { "maxruntime", 'T', POPT_ARG_INT, &options.maxruntime, 0,
-               "die if runtime exceeds this limit (in seconds)" },
+       {
+               .longName   = "debug",
+               .shortName  = 'd',
+               .argInfo    = POPT_ARG_STRING,
+               .arg        = &options.debuglevelstr,
+               .val        = 0,
+               .descrip    = "debug level",
+       },
+       {
+               .longName   = "timelimit",
+               .shortName  = 't',
+               .argInfo    = POPT_ARG_INT,
+               .arg        = &options.timelimit,
+               .val        = 0,
+               .descrip    = "timelimit (in seconds)",
+       },
+       {
+               .longName   = "node",
+               .shortName  = 'n',
+               .argInfo    = POPT_ARG_INT,
+               .arg        = &options.pnn,
+               .val        = 0,
+               .descrip    = "node specification - integer",
+       },
+       {
+               .longName   = NULL,
+               .shortName  = 'Y',
+               .argInfo    = POPT_ARG_NONE,
+               .arg        = &options.machinereadable,
+               .val        = 0,
+               .descrip    = "enable machine readable output",
+       },
+       {
+               .longName   = "separator",
+               .shortName  = 'x',
+               .argInfo    = POPT_ARG_STRING,
+               .arg        = &options.sep,
+               .val        = 0,
+               .descrip    = "specify separator for machine readable output",
+               .argDescrip = "CHAR",
+       },
+       {
+               .shortName  = 'X',
+               .argInfo    = POPT_ARG_NONE,
+               .arg        = &options.machineparsable,
+               .val        = 0,
+               .descrip    = "enable machine parsable output with separator |",
+       },
+       {
+               .longName   = "verbose",
+               .shortName  = 'v',
+               .argInfo    = POPT_ARG_NONE,
+               .arg        = &options.verbose,
+               .val        = 0,
+               .descrip    = "enable verbose output",
+       },
+       {
+               .longName   = "maxruntime",
+               .shortName  = 'T',
+               .argInfo    = POPT_ARG_INT,
+               .arg        = &options.maxruntime,
+               .val        = 0,
+               .descrip    = "die if runtime exceeds this limit (in seconds)",
+       },
        POPT_TABLEEND
 };