Re: Fix help option of contrib/oid2name

From: Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fix help option of contrib/oid2name
Date: 2018-08-24 04:28:00
Message-ID: 4dc449ad-0be3-8982-86b4-7ec628ae657e@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: 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 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 Content-Type Size
fix_oid2name_wip3.patch text/x-patch 11.5 KB
300_oid2name.pl application/x-perl 1.6 KB
301_vacuumlo.pl application/x-perl 737 bytes
fix_vacuumlo_wip3.patch text/x-patch 7.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-08-24 04:29:32 document that MergeAppend can now prune
Previous Message David Rowley 2018-08-24 03:12:12 Re: Removing useless DISTINCT clauses