New submission which put long options in alphabetical order, which seems more logical.

This is for reference to the next commitfest.

--
Fabien.
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 24dab1f..ba36e66 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -2080,6 +2080,30 @@ int
 main(int argc, char **argv)
 {
 	static struct option long_options[] = {
+		/* systematic long/short named options*/
+		{"client", required_argument, NULL, 'c'},
+		{"connect", no_argument, NULL, 'C'},
+		{"debug", no_argument, NULL, 'd'},
+		{"define", required_argument, NULL, 'D'},
+		{"file", required_argument, NULL, 'f'},
+		{"fill-factor", required_argument, NULL, 'F'},
+		{"host", required_argument, NULL, 'h'},
+		{"initialize", no_argument, NULL, 'i'},
+		{"jobs", required_argument, NULL, 'j'},
+		{"log", no_argument, NULL, 'l'},
+		{"no-vacuum", no_argument, NULL, 'n'},
+		{"port", required_argument, NULL, 'p'},
+		{"query-mode", required_argument, NULL, 'M'},
+		{"quiet-log", no_argument, NULL, 'q'},
+		{"report-latencies", no_argument, NULL, 'r'},
+		{"scale", required_argument, NULL, 's'},
+		{"select-only", no_argument, NULL, 'S'},
+		{"skip-some-update", no_argument, NULL, 'N'},
+		{"time", required_argument, NULL, 'T'},
+		{"transactions", required_argument, NULL, 't'},
+		{"username", required_argument, NULL, 'U'},
+		{"vacuum-all", no_argument, NULL, 'v'},
+		/* long-named only options */
 		{"foreign-keys", no_argument, &foreign_keys, 1},
 		{"index-tablespace", required_argument, NULL, 3},
 		{"tablespace", required_argument, NULL, 2},
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml
index 79b4baf..bc84ec0 100644
--- a/doc/src/sgml/pgbench.sgml
+++ b/doc/src/sgml/pgbench.sgml
@@ -150,6 +150,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-i</option></term>
+      <term><option>--initialize</option></term>
       <listitem>
        <para>
         Required to invoke initialization mode.
@@ -159,6 +160,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-n</option></term>
+      <term><option>--no-vacuum</option></term>
       <listitem>
        <para>
         Perform no vacuuming after initialization.
@@ -168,6 +170,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-F</option> <replaceable>fillfactor</></term>
+      <term><option>--fill-factor</option> <replaceable>fillfactor</></term>
       <listitem>
        <para>
         Create the <structname>pgbench_accounts</>,
@@ -180,6 +183,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-s</option> <replaceable>scale_factor</></term>
+      <term><option>--scale</option> <replaceable>scale_factor</></term>
       <listitem>
        <para>
         Multiply the number of rows generated by the scale factor.
@@ -196,6 +200,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-q</option></term>
+      <term><option>--quiet-log</option></term>
       <listitem>
        <para>
         Switch logging to quiet mode, producing only one progress message per 5
@@ -259,6 +264,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-c</option> <replaceable>clients</></term>
+      <term><option>--client</option> <replaceable>clients</></term>
       <listitem>
        <para>
         Number of clients simulated, that is, number of concurrent database
@@ -269,6 +275,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-C</option></term>
+      <term><option>--connect</option></term>
       <listitem>
        <para>
         Establish a new connection for each transaction, rather than
@@ -280,6 +287,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-d</option></term>
+      <term><option>--debug</option></term>
       <listitem>
        <para>
         Print debugging output.
@@ -289,6 +297,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-D</option> <replaceable>varname</><literal>=</><replaceable>value</></term>
+      <term><option>--define</option> <replaceable>varname</><literal>=</><replaceable>value</></term>
       <listitem>
        <para>
         Define a variable for use by a custom script (see below).
@@ -299,6 +308,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-f</option> <replaceable>filename</></term>
+      <term><option>--file</option> <replaceable>filename</></term>
       <listitem>
        <para>
         Read transaction script from <replaceable>filename</>.
@@ -311,6 +321,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-j</option> <replaceable>threads</></term>
+      <term><option>--jobs</option> <replaceable>threads</></term>
       <listitem>
        <para>
         Number of worker threads within <application>pgbench</application>.
@@ -324,6 +335,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-l</option></term>
+      <term><option>--log</option></term>
       <listitem>
        <para>
         Write the time taken by each transaction to a log file.
@@ -367,6 +379,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-M</option> <replaceable>querymode</></term>
+      <term><option>--query-mode</option> <replaceable>querymode</></term>
       <listitem>
        <para>
         Protocol to use for submitting queries to the server:
@@ -389,6 +402,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-n</option></term>
+      <term><option>--no-vacuum</option></term>
       <listitem>
        <para>
         Perform no vacuuming before running the test.
@@ -403,6 +417,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-N</option></term>
+      <term><option>--skip-some-update</option></term>
       <listitem>
        <para>
         Do not update <structname>pgbench_tellers</> and
@@ -415,6 +430,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-r</option></term>
+      <term><option>--report-latencies</option></term>
       <listitem>
        <para>
         Report the average per-statement latency (execution time from the
@@ -426,6 +442,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-s</option> <replaceable>scale_factor</></term>
+      <term><option>--scale</option> <replaceable>scale_factor</></term>
       <listitem>
        <para>
         Report the specified scale factor in <application>pgbench</>'s
@@ -440,6 +457,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-S</option></term>
+      <term><option>--select-only</option></term>
       <listitem>
        <para>
         Perform select-only transactions instead of TPC-B-like test.
@@ -449,6 +467,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-t</option> <replaceable>transactions</></term>
+      <term><option>--transactions</option> <replaceable>transactions</></term>
       <listitem>
        <para>
         Number of transactions each client runs.  Default is 10.
@@ -458,6 +477,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-T</option> <replaceable>seconds</></term>
+      <term><option>--time</option> <replaceable>seconds</></term>
       <listitem>
        <para>
         Run the test for this many seconds, rather than a fixed number of
@@ -469,6 +489,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-v</option></term>
+      <term><option>--vacuum-all</option></term>
       <listitem>
        <para>
         Vacuum all four standard tables before running the test.
@@ -495,6 +516,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-h</option> <replaceable>hostname</></term>
+      <term><option>--host</option> <replaceable>hostname</></term>
       <listitem>
        <para>
         The database server's host name
@@ -504,6 +526,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-p</option> <replaceable>port</></term>
+      <term><option>--port</option> <replaceable>port</></term>
       <listitem>
        <para>
         The database server's port number
@@ -513,6 +536,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
 
      <varlistentry>
       <term><option>-U</option> <replaceable>login</></term>
+      <term><option>--username</option> <replaceable>login</></term>
       <listitem>
        <para>
         The user name to connect as
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to