From 87c8489148d5e6d44b1d55f1325658222852232c Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 4 Jan 2010 18:55:00 -0800 Subject: [PATCH] Add extended vlog options to utilities The ovs-discover, ovs-dpctl, and ovs-ofctl man pages indicated that they supported extended vlog options (e.g., --log-file), but they actually did not. This commit adds them. Reported by Tetsuo NAKAGAWA --- utilities/ovs-discover.c | 9 ++++----- utilities/ovs-dpctl.c | 10 ++++++---- utilities/ovs-ofctl.c | 10 ++++------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/utilities/ovs-discover.c b/utilities/ovs-discover.c index dc91bce3d..2a7ba41df 100644 --- a/utilities/ovs-discover.c +++ b/utilities/ovs-discover.c @@ -282,7 +282,8 @@ parse_options(int argc, char *argv[]) OPT_ACCEPT_VCONN = UCHAR_MAX + 1, OPT_EXIT_WITHOUT_BIND, OPT_EXIT_AFTER_BIND, - OPT_NO_DETACH + OPT_NO_DETACH, + VLOG_OPTION_ENUMS }; static struct option long_options[] = { {"accept-vconn", required_argument, 0, OPT_ACCEPT_VCONN}, @@ -292,9 +293,9 @@ parse_options(int argc, char *argv[]) {"timeout", required_argument, 0, 't'}, {"pidfile", optional_argument, 0, OPT_PIDFILE}, {"overwrite-pidfile", no_argument, 0, OPT_OVERWRITE_PIDFILE}, - {"verbose", optional_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, + VLOG_LONG_OPTIONS, {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -354,9 +355,7 @@ parse_options(int argc, char *argv[]) OVS_PRINT_VERSION(0, 0); exit(EXIT_SUCCESS); - case 'v': - vlog_set_verbosity(optarg); - break; + VLOG_OPTION_HANDLERS case '?': exit(EXIT_FAILURE); diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index 8e9ed3dea..932aa893f 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -99,11 +99,15 @@ int main(int argc, char *argv[]) static void parse_options(int argc, char *argv[]) { + enum { + OPT_DUMMY = UCHAR_MAX + 1, + VLOG_OPTION_ENUMS + }; static struct option long_options[] = { {"timeout", required_argument, 0, 't'}, - {"verbose", optional_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, + VLOG_LONG_OPTIONS, {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -135,9 +139,7 @@ parse_options(int argc, char *argv[]) OVS_PRINT_VERSION(0, 0); exit(EXIT_SUCCESS); - case 'v': - vlog_set_verbosity(optarg); - break; + VLOG_OPTION_HANDLERS case '?': exit(EXIT_FAILURE); diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index db6038a03..199bd43ec 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -123,14 +123,15 @@ static void parse_options(int argc, char *argv[], struct settings *s) { enum { - OPT_STRICT = UCHAR_MAX + 1 + OPT_STRICT = UCHAR_MAX + 1, + VLOG_OPTION_ENUMS }; static struct option long_options[] = { {"timeout", required_argument, 0, 't'}, - {"verbose", optional_argument, 0, 'v'}, {"strict", no_argument, 0, OPT_STRICT}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, + VLOG_LONG_OPTIONS, VCONN_SSL_LONG_OPTIONS {0, 0, 0, 0}, }; @@ -166,14 +167,11 @@ parse_options(int argc, char *argv[], struct settings *s) OVS_PRINT_VERSION(OFP_VERSION, OFP_VERSION); exit(EXIT_SUCCESS); - case 'v': - vlog_set_verbosity(optarg); - break; - case OPT_STRICT: s->strict = true; break; + VLOG_OPTION_HANDLERS VCONN_SSL_OPTION_HANDLERS case '?': -- 2.43.0