s3:lib: Use C99 initializer for poptOption in netapi nltest
authorAndreas Schneider <asn@samba.org>
Tue, 8 Jan 2019 16:37:24 +0000 (17:37 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:15 +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/netlogon/nltest.c

index 9f96bdaef4e5e163b397af15c7ef2aa3051c16fd..2dd368f5ea9785e90a5f3eab50b7f0bf41948fbc 100644 (file)
@@ -220,36 +220,253 @@ int main(int argc, const char **argv)
        poptContext pc;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               {"server", 0, POPT_ARG_STRING, &opt_server, OPT_SERVER, "Servername", "SERVER"},
-               {"dbflag", 0, POPT_ARG_INT,   &opt_dbflag, OPT_DBFLAG, "New Debug Flag", "HEXFLAGS"},
-               {"sc_query", 0, POPT_ARG_STRING,   &opt_domain, OPT_SC_QUERY, "Query secure channel for domain on server", "DOMAIN"},
-               {"sc_reset", 0, POPT_ARG_STRING,   &opt_domain, OPT_SC_RESET, "Reset secure channel for domain on server to dcname", "DOMAIN"},
-               {"sc_verify", 0, POPT_ARG_STRING,   &opt_domain, OPT_SC_VERIFY, "Verify secure channel for domain on server", "DOMAIN"},
-               {"sc_change_pwd", 0, POPT_ARG_STRING,   &opt_domain, OPT_SC_CHANGE_PWD, "Change a secure channel password for domain on server", "DOMAIN"},
-               {"dsgetdc", 0, POPT_ARG_STRING, &opt_domain, OPT_DSGETDC, "Call DsGetDcName", "DOMAIN"},
-               {"pdc", 0, POPT_ARG_NONE, &opt_pdc, OPT_PDC, NULL},
-               {"ds", 0, POPT_ARG_NONE, &opt_ds, OPT_DS, NULL},
-               {"dsp", 0, POPT_ARG_NONE, &opt_dsp, OPT_DSP, NULL},
-               {"gc", 0, POPT_ARG_NONE, &opt_gc, OPT_GC, NULL},
-               {"kdc", 0, POPT_ARG_NONE, &opt_kdc, OPT_KDC, NULL},
-               {"timeserv", 0, POPT_ARG_NONE, &opt_timeserv, OPT_TIMESERV, NULL},
-               {"gtimeserv", 0, POPT_ARG_NONE, &opt_gtimeserv, OPT_GTIMESERV, NULL},
-               {"ws", 0, POPT_ARG_NONE, &opt_ws, OPT_WS, NULL},
-               {"netbios", 0, POPT_ARG_NONE, &opt_netbios, OPT_NETBIOS, NULL},
-               {"dns", 0, POPT_ARG_NONE, &opt_dns, OPT_DNS, NULL},
-               {"ip", 0, POPT_ARG_NONE, &opt_ip, OPT_IP, NULL},
-               {"force", 0, POPT_ARG_NONE, &opt_force, OPT_FORCE, NULL},
-               {"writable", 0, POPT_ARG_NONE, &opt_writable, OPT_WRITABLE, NULL},
-               {"avoidself", 0, POPT_ARG_NONE, &opt_avoidself, OPT_AVOIDSELF, NULL},
-               {"ldaponly", 0, POPT_ARG_NONE, &opt_ldaponly, OPT_LDAPONLY, NULL},
-               {"backg", 0, POPT_ARG_NONE, &opt_backg, OPT_BACKG, NULL},
-               {"ds_6", 0, POPT_ARG_NONE, &opt_ds_6, OPT_DS_6, NULL},
-               {"try_next_closest_site", 0, POPT_ARG_NONE, &opt_try_next_closest_site, OPT_TRY_NEXT_CLOSEST_SITE, NULL},
-               {"site", 0, POPT_ARG_STRING, &opt_site, OPT_SITE, "SITE"},
-               {"account", 0, POPT_ARG_STRING, &opt_account, OPT_ACCOUNT, "ACCOUNT"},
-               {"ret_dns", 0, POPT_ARG_NONE, &opt_ret_dns, OPT_RET_DNS, NULL},
-               {"ret_netbios", 0, POPT_ARG_NONE, &opt_ret_netbios, OPT_RET_NETBIOS, NULL},
-               {"dsregdns", 0, POPT_ARG_NONE, &opt_dsregdns, OPT_DSREGDNS, "Force registration of all DC-specific DNS records"},
+               {
+                       .longName   = "server",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_server,
+                       .val        = OPT_SERVER,
+                       .descrip    = "Servername",
+                       .argDescrip = "SERVER",
+               },
+               {
+                       .longName   = "dbflag",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_INT,
+                       .arg        = &opt_dbflag,
+                       .val        = OPT_DBFLAG,
+                       .descrip    = "New Debug Flag",
+                       .argDescrip = "HEXFLAGS",
+               },
+               {
+                       .longName   = "sc_query",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_domain,
+                       .val        = OPT_SC_QUERY,
+                       .descrip    = "Query secure channel for domain on server",
+                       .argDescrip = "DOMAIN",
+               },
+               {
+                       .longName   = "sc_reset",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_domain,
+                       .val        = OPT_SC_RESET,
+                       .descrip    = "Reset secure channel for domain on server to dcname",
+                       .argDescrip = "DOMAIN",
+               },
+               {
+                       .longName   = "sc_verify",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_domain,
+                       .val        = OPT_SC_VERIFY,
+                       .descrip    = "Verify secure channel for domain on server",
+                       .argDescrip = "DOMAIN",
+               },
+               {
+                       .longName   = "sc_change_pwd",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_domain,
+                       .val        = OPT_SC_CHANGE_PWD,
+                       .descrip    = "Change a secure channel password for domain on server",
+                       .argDescrip = "DOMAIN",
+               },
+               {
+                       .longName   = "dsgetdc",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_domain,
+                       .val        = OPT_DSGETDC,
+                       .descrip    = "Call DsGetDcName",
+                       .argDescrip = "DOMAIN",
+               },
+               {
+                       .longName   = "pdc",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_pdc,
+                       .val        = OPT_PDC,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ds",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ds,
+                       .val        = OPT_DS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "dsp",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_dsp,
+                       .val        = OPT_DSP,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "gc",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_gc,
+                       .val        = OPT_GC,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "kdc",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_kdc,
+                       .val        = OPT_KDC,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "timeserv",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_timeserv,
+                       .val        = OPT_TIMESERV,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "gtimeserv",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_gtimeserv,
+                       .val        = OPT_GTIMESERV,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ws",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ws,
+                       .val        = OPT_WS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "netbios",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_netbios,
+                       .val        = OPT_NETBIOS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "dns",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_dns,
+                       .val        = OPT_DNS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ip",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ip,
+                       .val        = OPT_IP,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "force",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_force,
+                       .val        = OPT_FORCE,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "writable",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_writable,
+                       .val        = OPT_WRITABLE,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "avoidself",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_avoidself,
+                       .val        = OPT_AVOIDSELF,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ldaponly",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ldaponly,
+                       .val        = OPT_LDAPONLY,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "backg",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_backg,
+                       .val        = OPT_BACKG,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ds_6",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ds_6,
+                       .val        = OPT_DS_6,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "try_next_closest_site",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_try_next_closest_site,
+                       .val        = OPT_TRY_NEXT_CLOSEST_SITE,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "site",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_site,
+                       .val        = OPT_SITE,
+                       .descrip    = "SITE",
+               },
+               {
+                       .longName   = "account",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &opt_account,
+                       .val        = OPT_ACCOUNT,
+                       .descrip    = "ACCOUNT",
+               },
+               {
+                       .longName   = "ret_dns",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ret_dns,
+                       .val        = OPT_RET_DNS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "ret_netbios",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_ret_netbios,
+                       .val        = OPT_RET_NETBIOS,
+                       .descrip    = NULL,
+               },
+               {
+                       .longName   = "dsregdns",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = &opt_dsregdns,
+                       .val        = OPT_DSREGDNS,
+                       .descrip    = "Force registration of all DC-specific DNS records",
+               },
                POPT_COMMON_LIBNETAPI_EXAMPLES
                POPT_TABLEEND
        };