s3:utils: Use C99 initializer for poptOption in smbstatus
authorAndreas Schneider <asn@samba.org>
Tue, 8 Jan 2019 11:21:36 +0000 (12:21 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Apr 2019 09:10:50 +0000 (09:10 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 83d25ca9d90897925a4431dd55e68c78244900b3)

source3/utils/status.c

index 0fe2c820eb2742dfd436eab73d4baf16cc5e552d..0acdfd3221a4b57a551ee55d623b7bb5a29b8300 100644 (file)
@@ -511,18 +511,102 @@ int main(int argc, const char *argv[])
        poptContext pc;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               {"processes",   'p', POPT_ARG_NONE,     NULL, 'p', "Show processes only" },
-               {"verbose",     'v', POPT_ARG_NONE,     NULL, 'v', "Be verbose" },
-               {"locks",       'L', POPT_ARG_NONE,     NULL, 'L', "Show locks only" },
-               {"shares",      'S', POPT_ARG_NONE,     NULL, 'S', "Show shares only" },
-               {"notify",      'N', POPT_ARG_NONE,     NULL, 'N', "Show notifies" },
-               {"user",        'u', POPT_ARG_STRING,   &username, 'u', "Switch to user" },
-               {"brief",       'b', POPT_ARG_NONE,     NULL, 'b', "Be brief" },
-               {"profile",     'P', POPT_ARG_NONE, NULL, 'P', "Do profiling" },
-               {"profile-rates", 'R', POPT_ARG_NONE, NULL, 'R', "Show call rates" },
-               {"byterange",   'B', POPT_ARG_NONE,     NULL, 'B', "Include byte range locks"},
-               {"numeric",     'n', POPT_ARG_NONE,     NULL, 'n', "Numeric uid/gid"},
-               {"fast",        'f', POPT_ARG_NONE,     NULL, 'f', "Skip checks if processes still exist"},
+               {
+                       .longName   = "processes",
+                       .shortName  = 'p',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'p',
+                       .descrip    = "Show processes only",
+               },
+               {
+                       .longName   = "verbose",
+                       .shortName  = 'v',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'v',
+                       .descrip    = "Be verbose",
+               },
+               {
+                       .longName   = "locks",
+                       .shortName  = 'L',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'L',
+                       .descrip    = "Show locks only",
+               },
+               {
+                       .longName   = "shares",
+                       .shortName  = 'S',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'S',
+                       .descrip    = "Show shares only",
+               },
+               {
+                       .longName   = "notify",
+                       .shortName  = 'N',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'N',
+                       .descrip    = "Show notifies",
+               },
+               {
+                       .longName   = "user",
+                       .shortName  = 'u',
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &username,
+                       .val        = 'u',
+                       .descrip    = "Switch to user",
+               },
+               {
+                       .longName   = "brief",
+                       .shortName  = 'b',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'b',
+                       .descrip    = "Be brief",
+               },
+               {
+                       .longName   = "profile",
+                       .shortName  =     'P',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'P',
+                       .descrip    = "Do profiling",
+               },
+               {
+                       .longName   = "profile-rates",
+                       .shortName  = 'R',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'R',
+                       .descrip    = "Show call rates",
+               },
+               {
+                       .longName   = "byterange",
+                       .shortName  = 'B',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'B',
+                       .descrip    = "Include byte range locks"
+               },
+               {
+                       .longName   = "numeric",
+                       .shortName  = 'n',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'n',
+                       .descrip    = "Numeric uid/gid"
+               },
+               {
+                       .longName   = "fast",
+                       .shortName  = 'f',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = 'f',
+                       .descrip    = "Skip checks if processes still exist"
+               },
                POPT_COMMON_SAMBA
                POPT_TABLEEND
        };