summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-01-11 15:14:09 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-28 10:29:13 +0100
commit3834ea867a4bf3d8c7742c5718927589390b98aa (patch)
tree3c69efe3d67f797cf1d6034690aacec8db08497c /source3/rpcclient
parentb0dbc7d1f5072e82346059a156af7e1c13dac28c (diff)
downloadsamba-3834ea867a4bf3d8c7742c5718927589390b98aa.tar.gz
s3:rpcclient: Use C99 initializer for poptOption in cmd_witness
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_witness.c146
1 files changed, 129 insertions, 17 deletions
diff --git a/source3/rpcclient/cmd_witness.c b/source3/rpcclient/cmd_witness.c
index f5cac97066c..3bc7d211606 100644
--- a/source3/rpcclient/cmd_witness.c
+++ b/source3/rpcclient/cmd_witness.c
@@ -115,13 +115,61 @@ static WERROR cmd_witness_Register(struct rpc_pipe_client *cli,
int c;
poptContext optCon;
struct poptOption optionsTable[] = {
- {"version", 'v', POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT, &version, WITNESS_V2, "witness version", "version"},
- {"V1", '1', POPT_ARG_LONG|POPT_ARG_VAL, &version, WITNESS_V1, "witness version 1", NULL},
- {"V2", '2', POPT_ARG_LONG|POPT_ARG_VAL, &version, WITNESS_V2, "witness version 2", NULL},
- {"net", 'n', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &net_name, 0, "net name", NULL},
- {"ip", 'i', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &ip_addr, 0, "ip address", NULL},
- {"client", 'c', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT|POPT_ARGFLAG_OPTIONAL, &client_name, 0, "client name", NULL},
- { NULL, 0, 0, NULL, 0 }
+ {
+ .longName = "version",
+ .shortName = 'v',
+ .argInfo = POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &version,
+ .val = WITNESS_V2,
+ .descrip = "witness version",
+ .argDescrip = "version"
+ },
+ {
+ .longName = "V1",
+ .shortName = '1',
+ .argInfo = POPT_ARG_LONG|POPT_ARG_VAL,
+ .arg = &version,
+ .val = WITNESS_V1,
+ .descrip = "witness version 1",
+ .argDescrip = NULL
+ },
+ {
+ .longName = "V2",
+ .shortName = '2',
+ .argInfo = POPT_ARG_LONG|POPT_ARG_VAL,
+ .arg = &version,
+ .val = WITNESS_V2,
+ .descrip = "witness version 2",
+ .argDescrip = NULL
+ },
+ {
+ .longName = "net",
+ .shortName = 'n',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &net_name,
+ .val = 0,
+ .descrip = "net name",
+ .argDescrip = NULL
+ },
+ {
+ .longName = "ip",
+ .shortName = 'i',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &ip_addr,
+ .val = 0,
+ .descrip = "ip address",
+ .argDescrip = NULL
+ },
+ {
+ .longName = "client",
+ .shortName = 'c',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT|POPT_ARGFLAG_OPTIONAL,
+ .arg = &client_name,
+ .val = 0,
+ .descrip = "client name",
+ .argDescrip = NULL
+ },
+ POPT_TABLEEND
};
use_only_one_rpc_pipe_hack(cli);
@@ -188,16 +236,80 @@ static WERROR cmd_witness_RegisterEx(struct rpc_pipe_client *cli,
int c;
poptContext optCon;
struct poptOption optionsTable[] = {
- {"version", 'v', POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT, &version, WITNESS_V2, "witness version", "version"},
- {"V1", '1', POPT_ARG_LONG|POPT_ARG_VAL, &version, WITNESS_V1, "witness version 1", NULL},
- {"V2", '2', POPT_ARG_LONG|POPT_ARG_VAL, &version, WITNESS_V2, "witness version 2", NULL},
- {"net", 'n', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &net_name, 0, "net name", NULL},
- {"ip", 'i', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &ip_addr, 0, "ip address", NULL},
- {"share", 's', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT, &share_name, 0, "share name", NULL},
- {"client", 'c', POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT|POPT_ARGFLAG_OPTIONAL, &client_name, 0, "client name", NULL},
- {"flags", 'f', POPT_ARG_LONG|POPT_ARGFLAG_OR|POPT_ARGFLAG_SHOW_DEFAULT, &flags, 0, "flags", NULL},
- {"timeout", 't', POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT, &timeout, 0, "timeout", NULL},
- { NULL, 0, 0, NULL, 0 }
+ {
+ .longName = "version",
+ .shortName = 'v',
+ .argInfo = POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &version,
+ .val = WITNESS_V2,
+ .descrip = "witness version",
+ .argDescrip = "version"
+ },
+ {
+ .longName = "V1",
+ .shortName = '1',
+ .argInfo = POPT_ARG_LONG|POPT_ARG_VAL,
+ .arg = &version,
+ .val = WITNESS_V1,
+ .descrip = "witness version 1",
+ },
+ {
+ .longName = "V2",
+ .shortName = '2',
+ .argInfo = POPT_ARG_LONG|POPT_ARG_VAL,
+ .arg = &version,
+ .val = WITNESS_V2,
+ .descrip = "witness version 2",
+ },
+ {
+ .longName = "net",
+ .shortName = 'n',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &net_name,
+ .val = 0,
+ .descrip = "net name",
+ },
+ {
+ .longName = "ip",
+ .shortName = 'i',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &ip_addr,
+ .val = 0,
+ .descrip = "ip address",
+ },
+ {
+ .longName = "share",
+ .shortName = 's',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &share_name,
+ .val = 0,
+ .descrip = "share name",
+ },
+ {
+ .longName = "client",
+ .shortName = 'c',
+ .argInfo = POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT|POPT_ARGFLAG_OPTIONAL,
+ .arg = &client_name,
+ .val = 0,
+ .descrip = "client name",
+ },
+ {
+ .longName = "flags",
+ .shortName = 'f',
+ .argInfo = POPT_ARG_LONG|POPT_ARGFLAG_OR|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &flags,
+ .val = 0,
+ .descrip = "flags",
+ },
+ {
+ .longName = "timeout",
+ .shortName = 't',
+ .argInfo = POPT_ARG_LONG|POPT_ARGFLAG_SHOW_DEFAULT,
+ .arg = &timeout,
+ .val = 0,
+ .descrip = "timeout",
+ },
+ POPT_TABLEEND
};
use_only_one_rpc_pipe_hack(cli);