s3:netapi: Use C99 initializer for poptOption in netapi example
authorAndreas Schneider <asn@samba.org>
Thu, 13 Dec 2018 09:19:07 +0000 (10:19 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:16 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/lib/netapi/examples/common.c

index bdc866926b0cf8b61d4451ea70e69199c7104762..358e0edc4c7ac3aad6b3cad491716576e7b82f4e 100644 (file)
@@ -57,11 +57,40 @@ void popt_common_callback(poptContext con,
 }
 
 struct poptOption popt_common_netapi_examples[] = {
-       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_callback },
-       { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Username used for connection", "USERNAME" },
-       { "password", 'p', POPT_ARG_STRING, NULL, 'p', "Password used for connection", "PASSWORD" },
-       { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Debuglevel", "DEBUGLEVEL" },
-       { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k', "Use Kerberos", NULL },
+       {
+               .argInfo = POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,
+               .arg = (void *)popt_common_callback,
+       },
+       {
+               .longName   = "user",
+               .shortName  = 'U',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'U',
+               .descrip    = "Username used for connection",
+               .argDescrip = "USERNAME",
+       },
+       {
+               .longName   = "password",
+               .shortName  = 'p',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'p',
+               .descrip    = "Password used for connection",
+               .argDescrip = "PASSWORD",
+       },
+       {
+               .longName   = "debuglevel",
+               .shortName  = 'd',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'd',
+               .descrip    = "Debuglevel",
+               .argDescrip = "DEBUGLEVEL",
+       },
+       {
+               .longName   = "kerberos",
+               .shortName  = 'k',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'k',
+               .descrip    = "Use Kerberos",
+       },
        POPT_TABLEEND
 };
-