diff options
author | Alex Wang <alexw@nicira.com> | 2014-10-16 13:27:32 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2014-10-28 18:43:11 -0700 |
commit | 451de37e7fe6a89a482771fbec5e653be6117380 (patch) | |
tree | b95caf67c9236afa85036aba47fd025aa8502357 /tests/test-jsonrpc.c | |
parent | 56cad66697eba8ee9b7c52ac3051407210dadc70 (diff) | |
download | openvswitch-451de37e7fe6a89a482771fbec5e653be6117380.tar.gz |
command-line: Add function to print command usage.
This commit adds a new variable in 'struct command' for
recording the command usage. Also, a new function is
added to print the usage given the array of defined
commands.
Later patch will use the output in bash command-line
completion script.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests/test-jsonrpc.c')
-rw-r--r-- | tests/test-jsonrpc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c index cf90c4434..1fd753f35 100644 --- a/tests/test-jsonrpc.c +++ b/tests/test-jsonrpc.c @@ -330,11 +330,11 @@ do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) } static struct command all_commands[] = { - { "listen", 1, 1, do_listen }, - { "request", 3, 3, do_request }, - { "notify", 3, 3, do_notify }, - { "help", 0, INT_MAX, do_help }, - { NULL, 0, 0, NULL }, + { "listen", NULL, 1, 1, do_listen }, + { "request", NULL, 3, 3, do_request }, + { "notify", NULL, 3, 3, do_notify }, + { "help", NULL, 0, INT_MAX, do_help }, + { NULL, NULL, 0, 0, NULL }, }; static struct command * |