@@ -329,48 +329,45 @@ usage(void)
329
329
"Usage:\n"
330
330
" %s [OPTION]... [DBNAME]\n"
331
331
"\nInitialization options:\n"
332
- " -i invokes initialization mode\n"
333
- " -F NUM fill factor\n"
334
- " -n do not run VACUUM after initialization\n"
335
- " -q quiet logging (one message each 5 seconds)\n"
336
- " -s NUM scaling factor\n"
337
- " --foreign-keys\n"
338
- " create foreign key constraints between tables\n"
332
+ " -i, --initialize invokes initialization mode\n"
333
+ " -F, --fillfactor=NUM set fill factor\n"
334
+ " -n, --no-vacuum do not run VACUUM after initialization\n"
335
+ " -q, --quiet quiet logging (one message each 5 seconds)\n"
336
+ " -s NUM, --scale NUM scaling factor\n"
337
+ " --foreign-keys create foreign key constraints between tables\n"
339
338
" --index-tablespace=TABLESPACE\n"
340
- " create indexes in the specified tablespace\n"
341
- " --tablespace=TABLESPACE\n"
342
- " create tables in the specified tablespace\n"
343
- " --unlogged-tables\n"
344
- " create tables as unlogged tables\n"
339
+ " create indexes in the specified tablespace\n"
340
+ " --tablespace=TABLESPACE create tables in the specified tablespace\n"
341
+ " --unlogged-tables create tables as unlogged tables\n"
345
342
"\nBenchmarking options:\n"
346
- " -c NUM number of concurrent database clients (default: 1)\n"
347
- " -C establish new connection for each transaction\n"
348
- " -D VARNAME=VALUE\n"
349
- " define variable for use by custom script\n"
350
- " -f FILENAME read transaction script from FILENAME\n"
351
- " -j NUM number of threads (default: 1)\n"
352
- " -l write transaction times to log file\n"
353
- " -M simple|extended|prepared\n"
354
- " protocol for submitting queries to server (default: simple)\n "
355
- " -n do not run VACUUM before tests \n"
356
- " -N do not update tables \"pgbench_tellers\" and \"pgbench_branches\" \n"
357
- " -r report average latency per command \n"
358
- " -s NUM report this scale factor in output \n"
359
- " -S perform SELECT-only transactions \n"
360
- " -t NUM number of transactions each client runs (default: 10) \n"
361
- " -T NUM duration of benchmark test in seconds\n "
362
- " -v vacuum all four standard tables before tests \n"
363
- " --aggregate-interval =NUM\n"
364
- " aggregate data over NUM seconds \n"
365
- " --sampling-rate =NUM\n"
366
- " fraction of transactions to log (e.g. 0.01 for 1%% sample )\n"
343
+ " -c, --client= NUM number of concurrent database clients (default: 1)\n"
344
+ " -C, --connect establish new connection for each transaction\n"
345
+ " -D, --define= VARNAME=VALUE\n"
346
+ " define variable for use by custom script\n"
347
+ " -f, --file= FILENAME read transaction script from FILENAME\n"
348
+ " -j, --jobs= NUM number of threads (default: 1)\n"
349
+ " -l, --log write transaction times to log file\n"
350
+ " -M, --protocol= simple|extended|prepared\n"
351
+ " protocol for submitting queries "
352
+ "(default: simple) \n"
353
+ " -n, --no-vacuum do not run VACUUM before tests \n"
354
+ " -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches \n"
355
+ " -r, --report-latencies report average latency per command \n"
356
+ " -s, --scale=NUM report this scale factor in output \n"
357
+ " -S, --select-only perform SELECT-only transactions \n"
358
+ " -t, --transactions number of transactions each client runs "
359
+ "(default: 10) \n"
360
+ " -T, --time =NUM duration of benchmark test in seconds \n"
361
+ " -v, --vacuum-all vacuum all four standard tables before tests \n"
362
+ " --aggregate-interval =NUM aggregate data over NUM seconds \n"
363
+ " --sampling-rate=NUM fraction of transactions to log (e.g. 0.01 for 1%%)\n"
367
364
"\nCommon options:\n"
368
- " -d print debugging output\n"
369
- " -h HOSTNAME database server host or socket directory\n"
370
- " -p PORT database server port number\n"
371
- " -U USERNAME connect as specified database user\n"
372
- " -V, --version output version information, then exit\n"
373
- " -?, --help show this help, then exit\n"
365
+ " -d, --debug print debugging output\n"
366
+ " -h, --host= HOSTNAME database server host or socket directory\n"
367
+ " -p, --port= PORT database server port number\n"
368
+ " -U, --username= USERNAME connect as specified database user\n"
369
+ " -V, --version output version information, then exit\n"
370
+ " -?, --help show this help, then exit\n"
374
371
"\n"
375
372
"Report bugs to <pgsql-bugs@postgresql.org>.\n" ,
376
373
progname , progname );
@@ -2109,6 +2106,30 @@ int
2109
2106
main (int argc , char * * argv )
2110
2107
{
2111
2108
static struct option long_options [] = {
2109
+ /* systematic long/short named options*/
2110
+ {"client" , required_argument , NULL , 'c' },
2111
+ {"connect" , no_argument , NULL , 'C' },
2112
+ {"debug" , no_argument , NULL , 'd' },
2113
+ {"define" , required_argument , NULL , 'D' },
2114
+ {"file" , required_argument , NULL , 'f' },
2115
+ {"fillfactor" , required_argument , NULL , 'F' },
2116
+ {"host" , required_argument , NULL , 'h' },
2117
+ {"initialize" , no_argument , NULL , 'i' },
2118
+ {"jobs" , required_argument , NULL , 'j' },
2119
+ {"log" , no_argument , NULL , 'l' },
2120
+ {"no-vacuum" , no_argument , NULL , 'n' },
2121
+ {"port" , required_argument , NULL , 'p' },
2122
+ {"protocol" , required_argument , NULL , 'M' },
2123
+ {"quiet" , no_argument , NULL , 'q' },
2124
+ {"report-latencies" , no_argument , NULL , 'r' },
2125
+ {"scale" , required_argument , NULL , 's' },
2126
+ {"select-only" , no_argument , NULL , 'S' },
2127
+ {"skip-some-updates" , no_argument , NULL , 'N' },
2128
+ {"time" , required_argument , NULL , 'T' },
2129
+ {"transactions" , required_argument , NULL , 't' },
2130
+ {"username" , required_argument , NULL , 'U' },
2131
+ {"vacuum-all" , no_argument , NULL , 'v' },
2132
+ /* long-named only options */
2112
2133
{"foreign-keys" , no_argument , & foreign_keys , 1 },
2113
2134
{"index-tablespace" , required_argument , NULL , 3 },
2114
2135
{"tablespace" , required_argument , NULL , 2 },
0 commit comments