s4:lib: Use C99 initializer for poptOption in popt_credentials
[sfrench/samba-autobuild/.git] / source4 / lib / cmdline / popt_credentials.c
index c06b8c73a8d8e9795df381e6a9efca0be1140fe6..5dd61f6339c30798721f7bea7e1922165b7211c9 100644 (file)
@@ -175,16 +175,79 @@ static void popt_common_credentials_callback(poptContext con,
 
 
 struct poptOption popt_common_credentials4[] = {
-       { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_credentials_callback },
-       { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
-       { "no-pass", 'N', POPT_ARG_NONE, &dont_ask, 'N', "Don't ask for a password" },
-       { "password", 0, POPT_ARG_STRING, NULL, OPT_PASSWORD, "Password" },
-       { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" },
-       { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password" },
-       { "simple-bind-dn", 0, POPT_ARG_STRING, NULL, OPT_SIMPLE_BIND_DN, "DN to use for a simple bind" },
-       { "kerberos", 'k', POPT_ARG_STRING, NULL, OPT_KERBEROS, "Use Kerberos, -k [yes|no]" },
-       { "krb5-ccache", 0, POPT_ARG_STRING, NULL, OPT_KRB5_CCACHE, "Credentials cache location for Kerberos" },
-       { "sign", 'S', POPT_ARG_NONE, NULL, OPT_SIGN, "Sign connection to prevent modification in transit" },
-       { "encrypt", 'e', POPT_ARG_NONE, NULL, OPT_ENCRYPT, "Encrypt connection for privacy" },
-       { NULL }
+       {
+               .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 = "[DOMAIN/]USERNAME[%PASSWORD]",
+       },
+       {
+               .longName   = "no-pass",
+               .shortName  = 'N',
+               .argInfo    = POPT_ARG_NONE,
+               .arg        = &dont_ask,
+               .val        = 'N',
+               .descrip    = "Don't ask for a password",
+       },
+       {
+               .longName   = "password",
+               .argInfo    = POPT_ARG_STRING,
+               .val        = OPT_PASSWORD,
+               .descrip    = "Password",
+       },
+       {
+               .longName   = "authentication-file",
+               .shortName  = 'A',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = 'A',
+               .descrip    = "Get the credentials from a file",
+               .argDescrip = "FILE",
+       },
+       {
+               .longName   = "machine-pass",
+               .shortName  = 'P',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = 'P',
+               .descrip    = "Use stored machine account password",
+       },
+       {
+               .longName   = "simple-bind-dn",
+               .argInfo    = POPT_ARG_STRING,
+               .val        = OPT_SIMPLE_BIND_DN,
+               .descrip    = "DN to use for a simple bind",
+       },
+       {
+               .longName   = "kerberos",
+               .shortName  = 'k',
+               .argInfo    = POPT_ARG_STRING,
+               .val        = OPT_KERBEROS,
+               .descrip    = "Use Kerberos, -k [yes|no]",
+       },
+       {
+               .longName   = "krb5-ccache",
+               .argInfo    = POPT_ARG_STRING,
+               .val        = OPT_KRB5_CCACHE,
+               .descrip    = "Credentials cache location for Kerberos",
+       },
+       {
+               .longName   = "sign",
+               .shortName  = 'S',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = OPT_SIGN,
+               .descrip    = "Sign connection to prevent modification in transit",
+       },
+       {
+               .longName   = "encrypt",
+               .shortName  = 'e',
+               .argInfo    = POPT_ARG_NONE,
+               .val        = OPT_ENCRYPT,
+               .descrip    = "Encrypt connection for privacy",
+       },
+       POPT_TABLEEND
 };