From: Andreas Schneider Date: Thu, 13 Dec 2018 09:19:07 +0000 (+0100) Subject: s3:netapi: Use C99 initializer for poptOption in netapi example X-Git-Tag: ldb-1.6.1~394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=025b32e5253f86ed348d917d57784fa3513cb1b5;p=thirdparty%2Fsamba.git s3:netapi: Use C99 initializer for poptOption in netapi example Signed-off-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- diff --git a/source3/lib/netapi/examples/common.c b/source3/lib/netapi/examples/common.c index bdc866926b0..358e0edc4c7 100644 --- a/source3/lib/netapi/examples/common.c +++ b/source3/lib/netapi/examples/common.c @@ -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 }; -