lib: Use the same style in the 'struct option'

Use same style in the 'struct option' as:
    struct option opt[] = {
        { a, b },
        { a, b },
        ...
        { a, b },
    };

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jiang Jiacheng 2022-11-22 09:50:01 +08:00 committed by Michal Privoznik
parent d6ecd766aa
commit 4b90adf65a
11 changed files with 69 additions and 69 deletions

View File

@ -90,7 +90,7 @@ parse_argv(int argc, char *argv[],
{ "help", no_argument, NULL, 'h' },
{ "connect", required_argument, NULL, 'c' },
{ "delay", required_argument, NULL, 'D' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
while ((arg = getopt_long(argc, argv, "+:dhc:D:", opt, NULL)) != -1) {

View File

@ -80,7 +80,7 @@ parse_argv(int argc, char *argv[],
{ "help", no_argument, NULL, 'h' },
{ "connect", required_argument, NULL, 'c' },
{ "seconds", required_argument, NULL, 's' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
while ((arg = getopt_long(argc, argv, "+:dhc:s:", opt, NULL)) != -1) {

View File

@ -816,7 +816,7 @@ int main(int argc, char **argv) {
{ "pid-file", required_argument, NULL, 'p' },
{ "version", no_argument, NULL, 'V' },
{ "help", no_argument, NULL, 'h' },
{0, 0, 0, 0}
{ 0, 0, 0, 0 },
};
privileged = geteuid() == 0;

View File

@ -620,7 +620,7 @@ int main(int argc, char **argv) {
{ "pid-file", required_argument, NULL, 'p' },
{ "version", no_argument, NULL, 'V' },
{ "help", no_argument, NULL, 'h' },
{0, 0, 0, 0}
{ 0, 0, 0, 0 },
};
privileged = geteuid() == 0;

View File

@ -817,7 +817,7 @@ int main(int argc, char **argv) {
{ "pid-file", required_argument, NULL, 'p' },
{ "version", no_argument, NULL, 'V' },
{ "help", no_argument, NULL, 'h' },
{0, 0, 0, 0}
{ 0, 0, 0, 0 },
};
if (virGettextInitialize() < 0 ||

View File

@ -1347,7 +1347,7 @@ vahParseArgv(vahControl * ctl, int argc, char **argv)
{ "replace", 0, 0, 'r' },
{ "remove", 0, 0, 'R' },
{ "uuid", 1, 0, 'u' },
{0, 0, 0, 0}
{ 0, 0, 0, 0 },
};
while ((arg = getopt_long(argc, argv, "acdDhrRH:b:u:p:f:F:", opt,

View File

@ -649,7 +649,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv)
{ "readonly", no_argument, NULL, 'r' },
{ "timing", no_argument, NULL, 't' },
{ "version", optional_argument, NULL, 'v' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
/* Standard (non-command) options. The leading + ensures that no

View File

@ -1324,7 +1324,7 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **argv)
{ "log", required_argument, NULL, 'l' },
{ "quiet", no_argument, NULL, 'q' },
{ "version", optional_argument, NULL, 'v' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
/* Standard (non-command) options. The leading + ensures that no

View File

@ -73,10 +73,10 @@ show_version(FILE *out, const char *argv0)
}
static const struct option argOptions[] = {
{ "help", 0, NULL, 'h', },
{ "version", 0, NULL, 'v', },
{ "quiet", 0, NULL, 'q', },
{ NULL, 0, NULL, '\0', }
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'v' },
{ "quiet", 0, NULL, 'q' },
{ NULL, 0, NULL, '\0' },
};
int

View File

@ -181,7 +181,7 @@ main(int argc, char **argv)
struct option opt[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", optional_argument, NULL, 'V' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
if (virInitialize() < 0) {
fprintf(stderr, _("Failed to initialize libvirt error handling"));

View File

@ -63,7 +63,7 @@ main(int argc,
struct option opt[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", optional_argument, NULL, 'v' },
{NULL, 0, NULL, 0}
{ NULL, 0, NULL, 0 },
};
if (virGettextInitialize() < 0)