Re: pg_dump.options.diff
От | Manfred Koizar |
---|---|
Тема | Re: pg_dump.options.diff |
Дата | |
Msg-id | nj581v0j7ilphbc1mafp7kf5ankoju9jah@4ax.com обсуждение исходный текст |
Ответ на | Re: pg_dump.options.diff ("Serguei Mokhov" <mokhov@cs.concordia.ca>) |
Ответы |
Re: pg_dump.options.diff
|
Список | pgsql-hackers |
On Thu, 2 Jan 2003 01:44:21 -0500, "Serguei Mokhov" <mokhov@cs.concordia.ca> 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 *longform, char *parm, char *desc) {int pos = 0; printf(" -%s", shortform);pos += 3 + strlen(shortform); #if defined(HAVE_GETOPT_LONG)printf(", --%s", longform);pos += 4 + strlen(longform); #endif if (parm) { printf("%c%s", PARMPREFIX, parm); pos += 1 + strlen(parm);}/*if*/ printf("%*c", 27 - pos, ' ');printf("%s\n", desc); }/*explain_option*/ #define xo explain_optionxo("f", "file", "FILENAME", "output file name");xo("F", "format", "c|t|p", "output file format (custom,tar, plain text)");xo("i", "ignore-version", NULL, "proceed even when server version mismatches\n" " pg_dump version");xo("v", "verbose", NULL, "verbose mode");xo("Z", "compress", "0-9", "compression levelfor compressed formats"); This is only a quick hack, I didn't care for _() and explain_option() could be smarter about multi line descriptions, but you get the idea ... ServusManfred
В списке pgsql-hackers по дате отправления: