1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Andreas Schneider 2019-01-11 15:14:09 +01:00 committed by Andreas Schneider
parent b0dbc7d1f5
commit 3834ea867a

View File

@ -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);