Skip to content

Commit a8da71e

Browse files
committed
Clean up some messages and fix missing translation support. Option --log
renamed to --log-file for clarity.
1 parent 380ab36 commit a8da71e

File tree

5 files changed

+33
-30
lines changed

5 files changed

+33
-30
lines changed

doc/src/sgml/ref/psql-ref.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.149 2005/08/14 18:49:29 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.150 2005/10/04 19:01:14 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -224,10 +224,10 @@ PostgreSQL documentation
224224

225225
<varlistentry>
226226
<term><option>-L <replaceable class="parameter">filename</replaceable></></term>
227-
<term><option>--log <replaceable class="parameter">filename</replaceable></></term>
227+
<term><option>--log-file <replaceable class="parameter">filename</replaceable></></term>
228228
<listitem>
229229
<para>
230-
Log all query output into file <replaceable
230+
Write all query output into file <replaceable
231231
class="parameter">filename</replaceable> in addition to the regular output source.
232232
</para>
233233
</listitem>

src/bin/psql/common.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.105 2005/09/20 21:43:08 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.106 2005/10/04 19:01:18 petere Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -74,7 +74,7 @@ pg_strdup(const char *string)
7474

7575
if (!string)
7676
{
77-
fprintf(stderr, _("%s: xstrdup: cannot duplicate null pointer (internal error)\n"),
77+
fprintf(stderr, _("%s: pg_strdup: cannot duplicate null pointer (internal error)\n"),
7878
pset.progname);
7979
exit(EXIT_FAILURE);
8080
}
@@ -719,15 +719,16 @@ PSQLexec(const char *query, bool start_xact)
719719
echo_hidden = SwitchVariable(pset.vars, "ECHO_HIDDEN", "noexec", NULL);
720720
if (echo_hidden != VAR_NOTSET)
721721
{
722-
printf("********* QUERY **********\n"
723-
"%s\n"
724-
"**************************\n\n", query);
722+
printf(_("********* QUERY **********\n"
723+
"%s\n"
724+
"**************************\n\n"), query);
725725
fflush(stdout);
726726
if (pset.logfile)
727727
{
728-
fprintf(pset.logfile, "********* QUERY **********\n"
729-
"%s\n"
730-
"**************************\n\n", query);
728+
fprintf(pset.logfile,
729+
_("********* QUERY **********\n"
730+
"%s\n"
731+
"**************************\n\n"), query);
731732
fflush(pset.logfile);
732733
}
733734

@@ -987,9 +988,10 @@ SendQuery(const char *query)
987988

988989
if (pset.logfile)
989990
{
990-
fprintf(pset.logfile, "********* QUERY **********\n"
991-
"%s\n"
992-
"**************************\n\n", query);
991+
fprintf(pset.logfile,
992+
_("********* QUERY **********\n"
993+
"%s\n"
994+
"**************************\n\n"), query);
993995
fflush(pset.logfile);
994996
}
995997

src/bin/psql/describe.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.125 2005/10/02 23:50:10 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.126 2005/10/04 19:01:18 petere Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -1176,13 +1176,13 @@ describeOneTableDetails(const char *schemaname,
11761176
{
11771177
appendPQExpBuffer(&buf, ", ");
11781178
appendPQExpBuffer(&buf, tmpbuf.data);
1179-
1179+
11801180
count_footers -= 2;
11811181
}
11821182
else
11831183
count_footers -= 1;
11841184
termPQExpBuffer(&tmpbuf);
1185-
1185+
11861186
footers[count_footers++] = pg_strdup(buf.data);
11871187
}
11881188
}
@@ -1365,15 +1365,15 @@ add_tablespace_footer(char relkind, Oid tablespace, char **footers,
13651365
printfPQExpBuffer(&buf,
13661366
newline?_("Tablespace: \"%s\""):_("tablespace \"%s\""),
13671367
PQgetvalue(result1, 0, 0));
1368-
1368+
13691369
footers[(*count)++] = pg_strdup(buf.data);
13701370
}
13711371
PQclear(result1);
1372-
1372+
13731373
return true;
13741374
}
13751375
}
1376-
1376+
13771377
return false;
13781378
}
13791379

src/bin/psql/print.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.76 2005/09/27 16:30:25 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.77 2005/10/04 19:01:18 petere Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "common.h"
@@ -1579,7 +1579,7 @@ printTable(const char *title,
15791579
border, output);
15801580
break;
15811581
default:
1582-
fprintf(stderr, _("illegal output format: %d"), opt->format);
1582+
fprintf(stderr, _("invalid output format (internal error): %d"), opt->format);
15831583
exit(EXIT_FAILURE);
15841584
}
15851585

src/bin/psql/startup.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.123 2005/09/20 18:59:02 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.124 2005/10/04 19:01:18 petere Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -191,14 +191,14 @@ main(int argc, char *argv[])
191191
}
192192

193193
if (options.username == NULL)
194-
password_prompt = strdup("Password: ");
194+
password_prompt = pg_strdup(_("Password: "));
195195
else
196196
{
197-
password_prompt = malloc(strlen("Password for user %s: ") - 2 +
197+
password_prompt = malloc(strlen(_("Password for user %s: ")) - 2 +
198198
strlen(options.username) + 1);
199-
sprintf(password_prompt,"Password for user %s: ", options.username);
199+
sprintf(password_prompt, _("Password for user %s: "), options.username);
200200
}
201-
201+
202202
if (pset.getPassword)
203203
password = simple_prompt(password_prompt, 100, false);
204204

@@ -252,7 +252,8 @@ main(int argc, char *argv[])
252252
{
253253
pset.logfile = fopen(options.logfilename, "a");
254254
if (!pset.logfile)
255-
fprintf(stderr, gettext("logfile open failed for %s\n\n"), options.logfilename);
255+
fprintf(stderr, _("%s: could not open log file \"%s\": %s\n"),
256+
pset.progname, options.logfilename, strerror(errno));
256257
}
257258

258259
/*
@@ -422,7 +423,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
422423
{"host", required_argument, NULL, 'h'},
423424
{"html", no_argument, NULL, 'H'},
424425
{"list", no_argument, NULL, 'l'},
425-
{"log", required_argument, NULL, 'L'},
426+
{"log-file", required_argument, NULL, 'L'},
426427
{"no-readline", no_argument, NULL, 'n'},
427428
{"output", required_argument, NULL, 'o'},
428429
{"port", required_argument, NULL, 'p'},
@@ -528,7 +529,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
528529

529530
if (!result)
530531
{
531-
fprintf(stderr, _("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value);
532+
fprintf(stderr, _("%s: could not set printing parameter \"%s\"\n"), pset.progname, value);
532533
exit(EXIT_FAILURE);
533534
}
534535

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy