1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Add working -q and --help options to testfixture.

FossilOrigin-Name: 404494e52b6385671ccde1c83b7b868986645536
This commit is contained in:
drh
2016-02-15 19:38:17 +00:00
parent 3719d10d11
commit 4b7b1c9c12
3 changed files with 29 additions and 7 deletions

View File

@ -374,6 +374,21 @@ proc do_not_use_codec {} {
reset_db
}
# Print a HELP message and exit
#
proc print_help_and_quit {} {
puts {Options:
--pause Wait for user input before continuing
--soft-heap-limit=N Set the soft-heap-limit to N
--maxerror=N Quit after N errors
--verbose=(0|1) Control the amount of output. Default '1'
--output=FILE set --verbose=2 and output to FILE. Implies -q
-q Shorthand for --verbose=0
--help This message
}
exit 1
}
# The following block only runs the first time this file is sourced. It
# does not run in slave interpreters (since the ::cmdlinearg array is
# populated before the test script is run in slave interpreters).
@ -483,6 +498,13 @@ if {[info exists cmdlinearg]==0} {
error "option --verbose= must be set to a boolean or to \"file\""
}
}
{.*help.*} {
print_help_and_quit
}
{^-q$} {
set cmdlinearg(output) test-out.txt
set cmdlinearg(verbose) 2
}
default {
lappend leftover $a