Commit a8da71e0 authored by Peter Eisentraut's avatar Peter Eisentraut

Clean up some messages and fix missing translation support. Option --log

renamed to --log-file for clarity.
parent 380ab366
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.149 2005/08/14 18:49:29 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.150 2005/10/04 19:01:14 petere Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -224,10 +224,10 @@ PostgreSQL documentation ...@@ -224,10 +224,10 @@ PostgreSQL documentation
<varlistentry> <varlistentry>
<term><option>-L <replaceable class="parameter">filename</replaceable></></term> <term><option>-L <replaceable class="parameter">filename</replaceable></></term>
<term><option>--log <replaceable class="parameter">filename</replaceable></></term> <term><option>--log-file <replaceable class="parameter">filename</replaceable></></term>
<listitem> <listitem>
<para> <para>
Log all query output into file <replaceable Write all query output into file <replaceable
class="parameter">filename</replaceable> in addition to the regular output source. class="parameter">filename</replaceable> in addition to the regular output source.
</para> </para>
</listitem> </listitem>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.105 2005/09/20 21:43:08 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.106 2005/10/04 19:01:18 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "common.h" #include "common.h"
...@@ -74,7 +74,7 @@ pg_strdup(const char *string) ...@@ -74,7 +74,7 @@ pg_strdup(const char *string)
if (!string) if (!string)
{ {
fprintf(stderr, _("%s: xstrdup: cannot duplicate null pointer (internal error)\n"), fprintf(stderr, _("%s: pg_strdup: cannot duplicate null pointer (internal error)\n"),
pset.progname); pset.progname);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -719,15 +719,16 @@ PSQLexec(const char *query, bool start_xact) ...@@ -719,15 +719,16 @@ PSQLexec(const char *query, bool start_xact)
echo_hidden = SwitchVariable(pset.vars, "ECHO_HIDDEN", "noexec", NULL); echo_hidden = SwitchVariable(pset.vars, "ECHO_HIDDEN", "noexec", NULL);
if (echo_hidden != VAR_NOTSET) if (echo_hidden != VAR_NOTSET)
{ {
printf("********* QUERY **********\n" printf(_("********* QUERY **********\n"
"%s\n" "%s\n"
"**************************\n\n", query); "**************************\n\n"), query);
fflush(stdout); fflush(stdout);
if (pset.logfile) if (pset.logfile)
{ {
fprintf(pset.logfile, "********* QUERY **********\n" fprintf(pset.logfile,
"%s\n" _("********* QUERY **********\n"
"**************************\n\n", query); "%s\n"
"**************************\n\n"), query);
fflush(pset.logfile); fflush(pset.logfile);
} }
...@@ -987,9 +988,10 @@ SendQuery(const char *query) ...@@ -987,9 +988,10 @@ SendQuery(const char *query)
if (pset.logfile) if (pset.logfile)
{ {
fprintf(pset.logfile, "********* QUERY **********\n" fprintf(pset.logfile,
"%s\n" _("********* QUERY **********\n"
"**************************\n\n", query); "%s\n"
"**************************\n\n"), query);
fflush(pset.logfile); fflush(pset.logfile);
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.125 2005/10/02 23:50:10 tgl Exp $ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.126 2005/10/04 19:01:18 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "describe.h" #include "describe.h"
...@@ -1176,13 +1176,13 @@ describeOneTableDetails(const char *schemaname, ...@@ -1176,13 +1176,13 @@ describeOneTableDetails(const char *schemaname,
{ {
appendPQExpBuffer(&buf, ", "); appendPQExpBuffer(&buf, ", ");
appendPQExpBuffer(&buf, tmpbuf.data); appendPQExpBuffer(&buf, tmpbuf.data);
count_footers -= 2; count_footers -= 2;
} }
else else
count_footers -= 1; count_footers -= 1;
termPQExpBuffer(&tmpbuf); termPQExpBuffer(&tmpbuf);
footers[count_footers++] = pg_strdup(buf.data); footers[count_footers++] = pg_strdup(buf.data);
} }
} }
...@@ -1365,15 +1365,15 @@ add_tablespace_footer(char relkind, Oid tablespace, char **footers, ...@@ -1365,15 +1365,15 @@ add_tablespace_footer(char relkind, Oid tablespace, char **footers,
printfPQExpBuffer(&buf, printfPQExpBuffer(&buf,
newline?_("Tablespace: \"%s\""):_("tablespace \"%s\""), newline?_("Tablespace: \"%s\""):_("tablespace \"%s\""),
PQgetvalue(result1, 0, 0)); PQgetvalue(result1, 0, 0));
footers[(*count)++] = pg_strdup(buf.data); footers[(*count)++] = pg_strdup(buf.data);
} }
PQclear(result1); PQclear(result1);
return true; return true;
} }
} }
return false; return false;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.76 2005/09/27 16:30:25 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.77 2005/10/04 19:01:18 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "common.h" #include "common.h"
...@@ -1579,7 +1579,7 @@ printTable(const char *title, ...@@ -1579,7 +1579,7 @@ printTable(const char *title,
border, output); border, output);
break; break;
default: default:
fprintf(stderr, _("illegal output format: %d"), opt->format); fprintf(stderr, _("invalid output format (internal error): %d"), opt->format);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2005, PostgreSQL Global Development Group * Copyright (c) 2000-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.123 2005/09/20 18:59:02 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.124 2005/10/04 19:01:18 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -191,14 +191,14 @@ main(int argc, char *argv[]) ...@@ -191,14 +191,14 @@ main(int argc, char *argv[])
} }
if (options.username == NULL) if (options.username == NULL)
password_prompt = strdup("Password: "); password_prompt = pg_strdup(_("Password: "));
else else
{ {
password_prompt = malloc(strlen("Password for user %s: ") - 2 + password_prompt = malloc(strlen(_("Password for user %s: ")) - 2 +
strlen(options.username) + 1); strlen(options.username) + 1);
sprintf(password_prompt,"Password for user %s: ", options.username); sprintf(password_prompt, _("Password for user %s: "), options.username);
} }
if (pset.getPassword) if (pset.getPassword)
password = simple_prompt(password_prompt, 100, false); password = simple_prompt(password_prompt, 100, false);
...@@ -252,7 +252,8 @@ main(int argc, char *argv[]) ...@@ -252,7 +252,8 @@ main(int argc, char *argv[])
{ {
pset.logfile = fopen(options.logfilename, "a"); pset.logfile = fopen(options.logfilename, "a");
if (!pset.logfile) if (!pset.logfile)
fprintf(stderr, gettext("logfile open failed for %s\n\n"), options.logfilename); fprintf(stderr, _("%s: could not open log file \"%s\": %s\n"),
pset.progname, options.logfilename, strerror(errno));
} }
/* /*
...@@ -422,7 +423,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) ...@@ -422,7 +423,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
{"host", required_argument, NULL, 'h'}, {"host", required_argument, NULL, 'h'},
{"html", no_argument, NULL, 'H'}, {"html", no_argument, NULL, 'H'},
{"list", no_argument, NULL, 'l'}, {"list", no_argument, NULL, 'l'},
{"log", required_argument, NULL, 'L'}, {"log-file", required_argument, NULL, 'L'},
{"no-readline", no_argument, NULL, 'n'}, {"no-readline", no_argument, NULL, 'n'},
{"output", required_argument, NULL, 'o'}, {"output", required_argument, NULL, 'o'},
{"port", required_argument, NULL, 'p'}, {"port", required_argument, NULL, 'p'},
...@@ -528,7 +529,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options) ...@@ -528,7 +529,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
if (!result) if (!result)
{ {
fprintf(stderr, _("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value); fprintf(stderr, _("%s: could not set printing parameter \"%s\"\n"), pset.progname, value);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment