From 4b90adf65a80c33f3359ba9af01759a2551b51cc Mon Sep 17 00:00:00 2001 From: Jiang Jiacheng Date: Tue, 22 Nov 2022 09:50:01 +0800 Subject: 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 Reviewed-by: Michal Privoznik --- tools/virsh.c | 24 ++++++++++++------------ tools/virt-admin.c | 14 +++++++------- tools/virt-host-validate.c | 8 ++++---- tools/virt-login-shell-helper.c | 6 +++--- tools/virt-pki-query-dn.c | 6 +++--- 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'tools') diff --git a/tools/virsh.c b/tools/virsh.c index b37d2ce12f..5696941550 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -638,18 +638,18 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) int longindex = -1; virshControl *priv = ctl->privData; struct option opt[] = { - {"connect", required_argument, NULL, 'c'}, - {"debug", required_argument, NULL, 'd'}, - {"escape", required_argument, NULL, 'e'}, - {"help", no_argument, NULL, 'h'}, - {"keepalive-interval", required_argument, NULL, 'k'}, - {"keepalive-count", required_argument, NULL, 'K'}, - {"log", required_argument, NULL, 'l'}, - {"quiet", no_argument, NULL, 'q'}, - {"readonly", no_argument, NULL, 'r'}, - {"timing", no_argument, NULL, 't'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "connect", required_argument, NULL, 'c' }, + { "debug", required_argument, NULL, 'd' }, + { "escape", required_argument, NULL, 'e' }, + { "help", no_argument, NULL, 'h' }, + { "keepalive-interval", required_argument, NULL, 'k' }, + { "keepalive-count", required_argument, NULL, 'K' }, + { "log", required_argument, NULL, 'l' }, + { "quiet", no_argument, NULL, 'q' }, + { "readonly", no_argument, NULL, 'r' }, + { "timing", no_argument, NULL, 't' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; /* Standard (non-command) options. The leading + ensures that no diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 11ba242742..85b010b95f 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1318,13 +1318,13 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **argv) size_t i; int longindex = -1; struct option opt[] = { - {"connect", required_argument, NULL, 'c'}, - {"debug", required_argument, NULL, 'd'}, - {"help", no_argument, NULL, 'h'}, - {"log", required_argument, NULL, 'l'}, - {"quiet", no_argument, NULL, 'q'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "connect", required_argument, NULL, 'c' }, + { "debug", required_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "log", required_argument, NULL, 'l' }, + { "quiet", no_argument, NULL, 'q' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; /* Standard (non-command) options. The leading + ensures that no diff --git a/tools/virt-host-validate.c b/tools/virt-host-validate.c index 4dae97910a..52ca729f85 100644 --- a/tools/virt-host-validate.c +++ b/tools/virt-host-validate.c @@ -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 diff --git a/tools/virt-login-shell-helper.c b/tools/virt-login-shell-helper.c index 3f8757e496..8feeb8f0fe 100644 --- a/tools/virt-login-shell-helper.c +++ b/tools/virt-login-shell-helper.c @@ -179,9 +179,9 @@ main(int argc, char **argv) bool autoshell = false; struct option opt[] = { - {"help", no_argument, NULL, 'h'}, - {"version", optional_argument, NULL, 'V'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", optional_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 }, }; if (virInitialize() < 0) { fprintf(stderr, _("Failed to initialize libvirt error handling")); diff --git a/tools/virt-pki-query-dn.c b/tools/virt-pki-query-dn.c index ee3783c1b2..2d7849feb7 100644 --- a/tools/virt-pki-query-dn.c +++ b/tools/virt-pki-query-dn.c @@ -61,9 +61,9 @@ main(int argc, int rv = 0; struct option opt[] = { - {"help", no_argument, NULL, 'h'}, - {"version", optional_argument, NULL, 'v'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", optional_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 }, }; if (virGettextInitialize() < 0) -- cgit v1.2.1