summaryrefslogtreecommitdiff
path: root/tests/test-heap.c
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2014-10-16 13:27:32 -0700
committerAlex Wang <alexw@nicira.com>2014-10-28 18:43:11 -0700
commit451de37e7fe6a89a482771fbec5e653be6117380 (patch)
treeb95caf67c9236afa85036aba47fd025aa8502357 /tests/test-heap.c
parent56cad66697eba8ee9b7c52ac3051407210dadc70 (diff)
downloadopenvswitch-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.c15
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