s3:lib: Use C99 initializer for poptOption in popt_common_cmdline
authorAndreas Schneider <asn@samba.org>
Thu, 13 Dec 2018 10:02:48 +0000 (11:02 +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/popt_common_cmdline.c

index 971234257e674b589f21c9f0e57ae072c50c90f1..95abec1a4409e7ebfb0a80b7561c92b0937c977b 100644 (file)
@@ -225,25 +225,75 @@ void popt_burn_cmdline_password(int argc, char *argv[])
 }
 
 struct poptOption popt_common_credentials[] = {
-       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,
-         (void *)popt_common_credentials_callback, 0, NULL },
-       { "user", 'U', POPT_ARG_STRING, NULL, 'U',
-         "Set the network username", "USERNAME" },
-       { "no-pass", 'N', POPT_ARG_NONE, NULL, 'N',
-         "Don't ask for a password" },
-       { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k',
-         "Use kerberos (active directory) authentication" },
-       { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A',
-         "Get the credentials from a file", "FILE" },
-       { "signing", 'S', POPT_ARG_STRING, NULL, 'S',
-         "Set the client signing state", "on|off|required" },
-       {"machine-pass", 'P', POPT_ARG_NONE, NULL, 'P',
-        "Use stored machine account password" },
-       {"encrypt", 'e', POPT_ARG_NONE, NULL, 'e',
-        "Encrypt SMB transport" },
-       {"use-ccache", 'C', POPT_ARG_NONE, NULL, 'C',
-        "Use the winbind ccache for authentication" },
-       {"pw-nt-hash", '\0', POPT_ARG_NONE, NULL, 'H',
-        "The supplied password is the NT hash" },
+       {
+               .argInfo    = POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,
+               .arg        = (void *)popt_common_credentials_callback,
+       },
+       {
+               .longName   = "user",
+               .shortName  = 'U',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'U',
+               .descrip    = "Set the network username",
+               .argDescrip = "USERNAME",
+       },
+       {
+               .longName   = "no-pass",
+               .shortName  = 'N',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'N',
+               .descrip    = "Don't ask for a password",
+       },
+       {
+               .longName   = "kerberos",
+               .shortName  = 'k',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'k',
+               .descrip    = "Use kerberos (active directory) authentication",
+       },
+       {
+               .longName   = "authentication-file",
+               .shortName  = 'A',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'A',
+               .descrip    = "Get the credentials from a file",
+               .argDescrip = "FILE",
+       },
+       {
+               .longName   = "signing",
+               .shortName  = 'S',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'S',
+               .descrip    = "Set the client signing state",
+               .argDescrip = "on|off|required",
+       },
+       {
+               .longName   = "machine-pass",
+               .shortName  = 'P',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'P',
+               .descrip    = "Use stored machine account password",
+       },
+       {
+               .longName   = "encrypt",
+               .shortName  = 'e',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'e',
+               .descrip    = "Encrypt SMB transport",
+       },
+       {
+               .longName   = "use-ccache",
+               .shortName  = 'C',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'C',
+               .descrip    = "Use the winbind ccache for authentication",
+       },
+       {
+               .longName   = "pw-nt-hash",
+               .shortName  = '\0',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'H',
+               .descrip    = "The supplied password is the NT hash",
+       },
        POPT_TABLEEND
 };