@@ -57,6 +57,10 @@ run() {
5757 SILENT=1
5858 shift
5959 ;;
60+ -h | --help)
61+ usage run
62+ exit
63+ ;;
6064 esac
6165 done
6266
@@ -160,18 +164,38 @@ function parse_header() {
160164
161165# Show usage
162166function usage() {
163- echo " USAGE: $COMMAND_NAME [-hv] [-f file_name] [CMD] [ARGS]"
164- echo " "
165- echo " OPTIONS:"
166- echo " -h (--help) print this message"
167- echo " -h (--help) print this message"
168- echo " -v (--verbose) verbose logging"
169- echo " -f (--file) file to test"
170- echo " "
171- echo " COMMANDS:"
172- echo " run Run test cases specified in the test file."
173- echo " Example: 'api-test -f test.json run test_case_1 test_case_2', 'api-test -f test.json run all'"
174- exit
167+ case $1 in
168+ run)
169+ echo " USAGE: $COMMAND_NAME [-v] -f file_name run [-hiIs] [ARGS]"
170+ echo " "
171+ echo " OPTIONS:"
172+ echo " -h (--help) print this message"
173+ echo " -i (--include) include header"
174+ echo " -I (--header-only) header only"
175+ echo " -s (--silent) silent mode"
176+ echo " "
177+ echo " ARGS:"
178+ echo " all Run all test case."
179+ echo " <test_case_name> Run provided test case."
180+ echo " "
181+ echo " EXAMPLE:"
182+ echo " 'api-test -f test.json run test_case_1 test_case_2', 'api-test -f test.json run all'"
183+ exit
184+ ;;
185+ * )
186+ echo " USAGE: $COMMAND_NAME [-hv] -f file_name [CMD] [ARGS]"
187+ echo " "
188+ echo " OPTIONS:"
189+ echo " -h (--help) print this message"
190+ echo " -v (--verbose) verbose logging"
191+ echo " -f (--file) file to test"
192+ echo " "
193+ echo " COMMANDS:"
194+ echo " run Run test cases specified in the test file."
195+ echo " Example: 'api-test -f test.json run test_case_1 test_case_2', 'api-test -f test.json run all'"
196+ exit
197+ ;;
198+ esac
175199}
176200
177201for arg in " $@ " ; do
0 commit comments