Re: pg_dump.options.diff

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump.options.diff
Дата
Msg-id 18064.1041489263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump.options.diff  ("Serguei Mokhov" <mokhov@cs.concordia.ca>)
Список pgsql-hackers
"Serguei Mokhov" <mokhov@cs.concordia.ca> 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_LONGchar* 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_LONGprintf(_("  -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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Cast your vote ...
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Cast your vote ...