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-heap.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-heap.c')
-rw-r--r-- | tests/test-heap.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/test-heap.c b/tests/test-heap.c index 3a0afa5fa..fcb33ccea 100644 --- a/tests/test-heap.c +++ b/tests/test-heap.c @@ -465,16 +465,17 @@ test_heap_raw_delete(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) } static const struct command commands[] = { - { "insert-delete-same-order", 0, 0, test_heap_insert_delete_same_order, }, - { "insert-delete-reverse-order", 0, 0, + { "insert-delete-same-order", NULL, 0, 0, + test_heap_insert_delete_same_order, }, + { "insert-delete-reverse-order", NULL, 0, 0, test_heap_insert_delete_reverse_order, }, - { "insert-delete-every-order", 0, 0, + { "insert-delete-every-order", NULL, 0, 0, test_heap_insert_delete_every_order, }, - { "insert-delete-same-order-with-dups", 0, 0, + { "insert-delete-same-order-with-dups", NULL, 0, 0, test_heap_insert_delete_same_order_with_dups, }, - { "raw-insert", 0, 0, test_heap_raw_insert, }, - { "raw-delete", 0, 0, test_heap_raw_delete, }, - { NULL, 0, 0, NULL, }, + { "raw-insert", NULL, 0, 0, test_heap_raw_insert, }, + { "raw-delete", NULL, 0, 0, test_heap_raw_delete, }, + { NULL, NULL, 0, 0, NULL, }, }; static void |