diff options
author | Alex Wang <alexw@nicira.com> | 2014-09-11 17:24:35 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2014-10-28 18:33:10 -0700 |
commit | 66fa2c884fe9aee48217a76189a148bf215e0f5d (patch) | |
tree | 4ef6bce4bef9ea40be3ec4ef9572e229d2c78a02 /utilities/ovs-appctl.c | |
parent | ee4dac3bb6dcef43c51f7ddf3ad954eab4c9ed0f (diff) | |
download | openvswitch-66fa2c884fe9aee48217a76189a148bf215e0f5d.tar.gz |
command-line: Add function to print all options.
This commit adds a function that prints (both long and short)
options of a ovs-* command. To use this function, option
'--option' is added to ovs-appctl/dpctl/ofctl and ovsdb-tool
commands. A future patch will use the option output to
conduct bash command-line completion.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'utilities/ovs-appctl.c')
-rw-r--r-- | utilities/ovs-appctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c index bb17ec27f..3d32cbd61 100644 --- a/utilities/ovs-appctl.c +++ b/utilities/ovs-appctl.c @@ -110,12 +110,14 @@ static const char * parse_command_line(int argc, char *argv[]) { enum { + OPT_START = UCHAR_MAX + 1, VLOG_OPTION_ENUMS }; static const struct option long_options[] = { {"target", required_argument, NULL, 't'}, {"execute", no_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, + {"option", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, {"timeout", required_argument, NULL, 'T'}, VLOG_LONG_OPTIONS, @@ -157,6 +159,10 @@ parse_command_line(int argc, char *argv[]) usage(); break; + case 'o': + print_options(long_options); + exit(EXIT_SUCCESS); + case 'T': time_alarm(atoi(optarg)); break; |