Re: Fix help option of contrib/oid2name - Mailing list pgsql-hackers

From Tatsuro Yamada
Subject Re: Fix help option of contrib/oid2name
Date
Msg-id 250bf65b-a2c4-f9c2-cfdf-0d48f21d6c53@lab.ntt.co.jp
Whole thread Raw
In response to Re: Fix help option of contrib/oid2name  (Tatsuro Yamada <yamada.tatsuro@lab.ntt.co.jp>)
Responses Re: Fix help option of contrib/oid2name
List pgsql-hackers
On 2018/08/21 12:57, Tatsuro Yamada wrote:
 > On 2018/08/21 12:40, Michael Paquier wrote:
 >> On Tue, Aug 21, 2018 at 12:26:15PM +0900, Tatsuro Yamada wrote:
 >>> BTW, can I add the patch to the Commitfest September?
 >>
 >> You should.
 >
 > Thanks, I'll do that.
 > I'll send 2 patches in this week, probably.

(I resend this email because I forgot to mark CC on my previous email. Sorry.)

I revised the patch and created new tap tests.

fix_oid2name_wip3.patch:
   bug fix
     - Remove "-P password" option from the document
   improvements
     - Divide "Options section" into "Options" and "Connection Options" sections in
       the help message (--help)
     - Add long options
     - Add "-H host" and "-h host" options to the help message and the document
     - Add environment variable (PGHOST, PGPORT and PGUSER) to the document

fix_vacuumlo_wip3.patch:
   improvements
     - Add long options
     - Add environment variable (PGHOST, PGPORT and PGUSER) to the document

Regarding to Long options,
I read the following both codes and I understand meanings of short options, so I
leave all long options in patches not only for connection options.

oid2name.c
     /* these are the opts structures for command line params */
     struct options
     {
         eary       *tables;
         eary       *oids;
         eary       *filenodes;

         bool        quiet;
         bool        systables;
         bool        indexes;
         bool        nodb;
         bool        extended;
         bool        tablespaces;

         char       *dbname;
         char       *hostname;
         char       *port;
         char       *username;
         const char *progname;
     };

vacuumlo.c
     struct _param
     {
         char       *pg_user;
         enum trivalue pg_prompt;
         char       *pg_port;
         char       *pg_host;
         const char *progname;
         int         verbose;
         int         dry_run;
         long        transaction_limit;
     };


Following TAP tests is for checking command-line options but I coudn't add some
test cases such as it is required argument and mixed varaiety of options.
I'm not sure about naming rule of tap test, so I added 300 and 301 to names as
temporarily. Please rename these files to more suitable names.

   300_oid2name.pl
   301_vacuumlo.pl

Please find attached files.

Thanks,
Tatsuro Yamada


Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: document that MergeAppend can now prune
Next
From: "Iwata, Aya"
Date:
Subject: libpq debug log