Re: [HACKERS] pg_dump.options.diff

2003-01-04 Thread Peter Eisentraut
Serguei Mokhov writes: #if defined(HAVE_GETOPT_LONG) #define xo(long,short,desc) printf(%s %s\n, long, desc) #else #define xo(long,short,desc) printf(%s %s\n, short, desc) #endif seems relatively generic, so it could be used by more than one tool. As long as we're spending time on this,

Re: [HACKERS] pg_dump.options.diff

2003-01-04 Thread Peter Eisentraut
Tom Lane writes: As long as we're spending time on this, why not just write our own version of getopt_long()? Seems like a fine idea to me ... who's volunteering? Doing it now... -- Peter Eisentraut [EMAIL PROTECTED] ---(end of

Re: [HACKERS] pg_dump.options.diff -- Take III

2003-01-03 Thread Serguei Mokhov
hmmm... hate to resend it, but i have never seen this passing through... re-attempt - Original Message - From: Serguei Mokhov [EMAIL PROTECTED] Sent: January 02, 2003 6:37 PM Subject: Re: [HACKERS] pg_dump.options.diff -- Take III - Original Message - From: Tom Lane [EMAIL

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Manfred Koizar
On Thu, 2 Jan 2003 01:44:21 -0500, Serguei Mokhov [EMAIL PROTECTED] wrote: Either way, something has to be donw about this... Just another way to do it: #if defined(HAVE_GETOPT_LONG) #define PARMPREFIX '=' #else #define PARMPREFIX ' ' #endif static void explain_option(char *shortform, char

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Tom Lane
Manfred Koizar [EMAIL PROTECTED] writes: Just another way to do it: #define xo explain_option xo(f, file, FILENAME, output file name); Perhaps better would be: #if defined(HAVE_GETOPT_LONG) #define xo(long,short,desc) printf(%-27s %s\n, long, desc) #else #define xo(long,short,desc)

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Serguei Mokhov
- Original Message - From: Tom Lane [EMAIL PROTECTED] Sent: January 02, 2003 9:29 AM Maybe we should not try to be cute, but just do #if defined(HAVE_GETOPT_LONG) #define xo(long,short,desc) printf(%s %s\n, long, desc) #else #define xo(long,short,desc) printf(%s %s\n, short,

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Tom Lane
Serguei Mokhov [EMAIL PROTECTED] writes: Looks good to me, but there is still a little inconvenience of multiline option descriptions, and the above won't handle it nicely. True, a multiline description would have to look like xo(_(-f, --file=FILENAME), _(-f FILENAME

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Serguei Mokhov
- Original Message - From: Tom Lane [EMAIL PROTECTED] Sent: January 02, 2003 1:58 PM Serguei Mokhov [EMAIL PROTECTED] writes: Looks good to me, but there is still a little inconvenience of multiline option descriptions, and the above won't handle it nicely. True, a multiline

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Tom Lane
Serguei Mokhov [EMAIL PROTECTED] writes: Now, this: #if defined(HAVE_GETOPT_LONG) #define xo(long,short,desc) printf(%s %s\n, long, desc) #else #define xo(long,short,desc) printf(%s %s\n, short, desc) #endif seems relatively generic, so it could be used by more than one tool. But

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Serguei Mokhov
- Original Message - From: Tom Lane [EMAIL PROTECTED] Sent: January 02, 2003 3:20 PM #if defined(HAVE_GETOPT_LONG) #define xo(long,short,desc) printf(%s %s\n, long, desc) #else #define xo(long,short,desc) printf(%s %s\n, short, desc) #endif seems relatively generic, so it

Re: [HACKERS] pg_dump.options.diff

2003-01-02 Thread Tom Lane
Serguei Mokhov [EMAIL PROTECTED] writes: But there's no good place to put it. I'd say just stick it into each tool; it's no worse than repeating the existence of a usage() subroutine in each tool. It ended up being in dumputils.h I really don't like putting a macro with a name as short as

[HACKERS] pg_dump.options.diff

2003-01-01 Thread Serguei Mokhov
Hello, Happy New Year everyone, Attached is an attempt to eliminate duplicate pg_dump option descriptions, and have a single description for both short and long options. For me, as for a translator, this eliminates the need to maintain the two, exactly same, sets of 24 sentences. If this is

Re: [HACKERS] pg_dump.options.diff

2003-01-01 Thread Tom Lane
Serguei Mokhov [EMAIL PROTECTED] writes: Attached is an attempt to eliminate duplicate pg_dump option descriptions, and have a single description for both short and long options. For me, as for a translator, this eliminates the need to maintain the two, exactly same, sets of 24 sentences.

Re: [HACKERS] pg_dump.options.diff

2003-01-01 Thread Serguei Mokhov
- Original Message - From: Tom Lane [EMAIL PROTECTED] 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