| 367 | # ----------------------------------------------------------------------------- |
| 368 | |
| 369 | def parseargs(): |
| 370 | parser = argparse.ArgumentParser(description=_help) |
| 371 | |
| 372 | parser.add_argument("tests", metavar="TEST", choices=[[], "all", "none", "bitmap_scan_tests", "btree_ao_scan_tests", |
| 373 | "bitmap_ndv_scan_tests", "index_join_tests", "bfv_join_tests", |
| 374 | "index_only_scan_tests", "brin_tests"], |
| 375 | nargs="*", |
| 376 | help="Run these tests (all, none, bitmap_scan_tests, btree_ao_scan_tests, bitmap_ndv_scan_tests, " |
| 377 | "index_join_tests, bfv_join_tests, index_only_scan_tests, brin_tests), default is none") |
| 378 | parser.add_argument("--create", action="store_true", |
| 379 | help="Create the tables to use in the test") |
| 380 | parser.add_argument("--execute", type=int, default="0", |
| 381 | help="Number of times to execute queries, 0 (the default) means explain only") |
| 382 | parser.add_argument("--drop", action="store_true", |
| 383 | help="Drop the tables used in the test when finished") |
| 384 | parser.add_argument("--verbose", action="store_true", |
| 385 | help="Print more verbose output") |
| 386 | parser.add_argument("--logFile", default="", |
| 387 | help="Log diagnostic output to a file") |
| 388 | parser.add_argument("--host", default="", |
| 389 | help="Host to connect to (default is localhost or $PGHOST, if set).") |
| 390 | parser.add_argument("--port", type=int, default="0", |
| 391 | help="Port on the host to connect to (default is 0 or $PGPORT, if set)") |
| 392 | parser.add_argument("--dbName", default="", |
| 393 | help="Database name to connect to") |
| 394 | parser.add_argument("--appendOnly", action="store_true", |
| 395 | help="Create an append-only table. Default is a heap table") |
| 396 | parser.add_argument("--numRows", type=int, default="10000000", |
| 397 | help="Number of rows to INSERT INTO the table (default is 10 million)") |
| 398 | |
| 399 | parser.set_defaults(verbose=False, filters=[], slice=(None, None)) |
| 400 | |
| 401 | # Parse the command line arguments |
| 402 | args = parser.parse_args() |
| 403 | return args, parser |
| 404 | |
| 405 | |
| 406 | def log_output(str): |