Re: pg_dump.options.diff

From: "Serguei Mokhov" <mokhov(at)cs(dot)concordia(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Subject: Re: pg_dump.options.diff
Date: 2003-01-02 06:44:21
Message-ID: 003b01c2b22a$62be3b80$0301a8c0@gunnymede.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: January 02, 2003 1:34 AM

> Perhaps it would work better to do something like
>
> #ifdef HAVE_GETOPT_LONG
> char* f_option = _("-f, --file=FILENAME ");
> ... etc ...
> #else /* not HAVE_GETOPT_LONG */
> char* f_option = _("-f FILENAME ");
> ... etc ...
> #endif /* not HAVE_GETOPT_LONG */
>
> printf(_(" %s output file name\n"), f_option);
> ... etc ...
>
> That seems to reduce the amount of duplication without breaking things
> up into chunks that aren't independent concepts.

Thank you for your comment, Tom.

A slightly more readable version of the above could be:

> #ifdef HAVE_GETOPT_LONG
> char* data_only_option = _("-f, --file=FILENAME ");
> char* blobs_option = _("-b, --blobs ");
> ... etc ...
> #else /* not HAVE_GETOPT_LONG */
> char* data_only_option = _("-f FILENAME ");
> char* blobs_option = _("-b ");
> ... etc ...
> #endif /* not HAVE_GETOPT_LONG */
>
> printf(_(" %s output file name\n"), data_only_option);
> printf(_(" %s include large objects in dump\n"), blobs_option);
> ... etc ...

It loos like better than the current setup.
Either way, something has to be donw about this...

-s

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Childs 2003-01-02 08:17:11 Re: Cast your vote ...
Previous Message Christopher Kings-Lynne 2003-01-02 06:43:15 Re: Cast your vote ...

Browse pgsql-patches by date

  From Date Subject
Next Message Serguei Mokhov 2003-01-02 08:41:57 more adequate usage msg: pg_controldata.diff
Previous Message Tom Lane 2003-01-02 06:34:23 Re: pg_dump.options.diff