"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.

Offhand, this cure strikes me as much worse than the disease.  You've
converted code which was understandable, if somewhat repetitious, into
code that can be understood by neither programmers nor translators.
The text strings have been broken into fragments that don't make any
sense individually --- which probably creates translating problems,
as well as opportunities for programmer error.

I see your complaint, but this doesn't seem like a good way to fix it.

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.

However, I'm not convinced that the above is better than what we have
--- it's really not obvious that the above is more maintainable than

#ifdef HAVE_GETOPT_LONG
        printf(_("  -f, --file=FILENAME      output file name\n"));
#else /* not HAVE_GETOPT_LONG */
        printf(_("  -f FILENAME              output file name\n"));
#endif /* not HAVE_GETOPT_LONG */

There are worse things than a little repetitiveness, and creating
the opportunity to mismatch a flag with its description may well
be one of them.

Comments?  Can anyone do better?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to