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,
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
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
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
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)
- 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,
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
- 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
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
- 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
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
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
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.
- 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
14 matches
Mail list logo