Re: pg_dump.options.diff

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump.options.diff
Дата
Msg-id 19899.1041517779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_dump.options.diff  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-hackers
Manfred Koizar <mkoi-pg@aon.at> 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)  printf("%-27s %s\n", short, desc)
#endif
xo(_("-f, --file=FILENAME"),   _("-f FILENAME"),   _("output file name"));

which avoids putting a lot of "smarts" (read: restrictions) into the
subroutine, but still keeps most of the other benefits, including:
* keeping the segments of the description together in the source code, and rationally organized from a translation
standpoint;
* only one place to change to adjust the column width.

Although it occurs to me that with the existing setup, it's possible
for the translator to unilaterally alter the column width for the
switches, which is something he'd definitely like to be able to do.
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, desc)
#endif
xo(_("-f, --file=FILENAME    "),   _("-f FILENAME            "),   _("output file name"));

so that the column spacing remains under control of the translator.
        regards, tom lane


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

Предыдущее
От: Dan Langille
Дата:
Сообщение: Re: PostgreSQL Password Cracker
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Autocommit off and transaction isolation level