summaryrefslogtreecommitdiff
path: root/tests/test-util.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-util.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-util.c')
-rw-r--r--tests/test-util.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/test-util.c b/tests/test-util.c
index a8060b0c4..fd01fcb92 100644
--- a/tests/test-util.c
+++ b/tests/test-util.c
@@ -1053,24 +1053,24 @@ test_file_name(int argc, char *argv[])
#endif /* _WIN32 */
static const struct command commands[] = {
- {"ctz", 0, 0, test_ctz},
- {"clz", 0, 0, test_clz},
- {"round_up_pow2", 0, 0, test_round_up_pow2},
- {"round_down_pow2", 0, 0, test_round_down_pow2},
- {"count_1bits", 0, 0, test_count_1bits},
- {"log_2_floor", 0, 0, test_log_2_floor},
- {"bitwise_copy", 0, 0, test_bitwise_copy},
- {"bitwise_zero", 0, 0, test_bitwise_zero},
- {"bitwise_one", 0, 0, test_bitwise_one},
- {"bitwise_is_all_zeros", 0, 0, test_bitwise_is_all_zeros},
- {"follow-symlinks", 1, INT_MAX, test_follow_symlinks},
- {"assert", 0, 0, test_assert},
- {"ovs_scan", 0, 0, test_ovs_scan},
- {"snprintf", 0, 0, test_snprintf},
+ {"ctz", NULL, 0, 0, test_ctz},
+ {"clz", NULL, 0, 0, test_clz},
+ {"round_up_pow2", NULL, 0, 0, test_round_up_pow2},
+ {"round_down_pow2", NULL, 0, 0, test_round_down_pow2},
+ {"count_1bits", NULL, 0, 0, test_count_1bits},
+ {"log_2_floor", NULL, 0, 0, test_log_2_floor},
+ {"bitwise_copy", NULL, 0, 0, test_bitwise_copy},
+ {"bitwise_zero", NULL, 0, 0, test_bitwise_zero},
+ {"bitwise_one", NULL, 0, 0, test_bitwise_one},
+ {"bitwise_is_all_zeros", NULL, 0, 0, test_bitwise_is_all_zeros},
+ {"follow-symlinks", NULL, 1, INT_MAX, test_follow_symlinks},
+ {"assert", NULL, 0, 0, test_assert},
+ {"ovs_scan", NULL, 0, 0, test_ovs_scan},
+ {"snprintf", NULL, 0, 0, test_snprintf},
#ifndef _WIN32
- {"file_name", 1, INT_MAX, test_file_name},
+ {"file_name", NULL, 1, INT_MAX, test_file_name},
#endif
- {NULL, 0, 0, NULL},
+ {NULL, NULL, 0, 0, NULL},
};
static void