Hello

Here is next update


2014-06-25 17:17 GMT+02:00 MauMau <maumau...@gmail.com>:

> OK, let me help you, though I'm only a Japanese who is never confident in
> my English.
>
> (1)
> As Fujii-san pointed out, could you add explanation for --help-variables
> in doc/src/sgml/ref/psqlref.sgml?
>
>
> (2)
>
> + printf(_("  --help-variables         list of available configuration
> variables (options), then exit\n"));
>
> should better be:
>
> + printf(_("  --help-variables         show A list of all specially
> treated variables, then exit\n"));
>
> This follows the psql manual page.  Similarly,
>
> + printf(_("List of variables (options) for use from command line.\n"));
>
> should be:
>
> + printf(_("List of specially treated variables.\n"));
>
>
> (3)
> + printf(_("  ECHO               control what input can be writtent to
> standard output [all, queries]\n"));
>
> "writtent" should be "written".  "controls" should be "control" like other
> options.
>
>
> (4)
> + printf(_("  ECHO_HIDDEN        display internal queries (same as -E
> option)\n"));
>
> should better be:
>
> + printf(_("  ECHO_HIDDEN        display internal queries executed by
> backslash commands\n"));
>
> I think "(same as ...)" can be omitted to keep the description short.  If
> you want to retain it, other variables should also accompany similar
> description, such as -a for ECHO.
>
>
> (5)
> + printf(_("  FETCH_COUNT        fetch many rows at a time (use less
> memory) (default 0 unlimited)\n"));
>
> should better be:
>
> + printf(_("  FETCH_COUNT        the number of result rows to fetch and
> display at a time (default: 0=unlimited)\n"));
>
>
> (6)
> + printf(_("  HISTCONTROL        when set, controls history list
> [ignorespace, ignoredups, ignoreboth]\n"));
>
> should better be:
>
> + printf(_("  HISTCONTROL        control history list [ignorespace,
> ignoredups, ignoreboth]\n"));
>
>
> (7)
> + printf(_("  USER               the database user currently
> connected\n"));
>
> should add "as" at the end:
>
> + printf(_("  USER               the database user currently connected
> as\n"));
>
>
> (8)
> "Printing options" section lack the following ones described in psql
> manual:
>
> columns
> expanded (or x)
> footer
> numericlocale
> tableattr (or T)
>

fixed


>
>
> (9)
> + printf(_("\nEnvironment options:\n"));
>
> should be ""Environment variables".  And this section lacks description
> for Windows, such as:
>
> + printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE]
> in interactive mode\n\n"));
>
> + printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));
>

??? -

Regards

Pavel


>
> Regards
> MauMau
>
>
commit 4d77ccf19ac77dc0f43a58f4d2b74d4aebed871d
Author: Pavel Stehule <pavel.steh...@gooddata.com>
Date:   Mon Jun 23 19:38:41 2014 +0200

    without comments

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index ee6ec3a..6a172dc 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -556,6 +556,15 @@ EOF
       </listitem>
     </varlistentry>
 
+    <varlistentry>
+      <term><option>--help-variables</></term>
+      <listitem>
+      <para>
+      Show help about <application>psql</application> variables,
+      and exit.
+      </para>
+      </listitem>
+    </varlistentry>
   </variablelist>
  </refsect1>
 
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 3aa3c16..1304e1a 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -78,12 +78,13 @@ usage(void)
 	printf(_("  -f, --file=FILENAME      execute commands from file, then exit\n"));
 	printf(_("  -l, --list               list available databases, then exit\n"));
 	printf(_("  -v, --set=, --variable=NAME=VALUE\n"
-			 "                           set psql variable NAME to VALUE\n"));
+			 "                           set psql variable NAME to VALUE e.g.: -v ON_ERROR_STOP=1\n"));
 	printf(_("  -V, --version            output version information, then exit\n"));
 	printf(_("  -X, --no-psqlrc          do not read startup file (~/.psqlrc)\n"));
 	printf(_("  -1 (\"one\"), --single-transaction\n"
 			 "                           execute as a single transaction (if non-interactive)\n"));
 	printf(_("  -?, --help               show this help, then exit\n"));
+	printf(_("  --help-variables         show a list of all specially treated variables, then exit\n"));
 
 	printf(_("\nInput and output options:\n"));
 	printf(_("  -a, --echo-all           echo all input from script\n"));
@@ -279,6 +280,92 @@ slashUsage(unsigned short int pager)
 }
 
 
+/*
+ * show list of available variables (options) from command line
+ */
+void
+help_variables(void)
+{
+	printf(_("List of specially treated variables.\n"));
+
+	printf(_("psql variables:\n"));
+	printf(_("Usage:\n"));
+	printf(_("  psql --set=NAME=VALUE\n  or \\set NAME VALUE in interactive mode\n\n"));
+
+	printf(_("  AUTOCOMMIT         successful SQL commands are automatically committed\n"));
+	printf(_("  COMP_KEYWORD_CASE  determines which letter case to use when completing an SQL key word\n"));
+	printf(_("  DBNAME             name of currently connected database\n"));
+	printf(_("  ECHO               control what input can be written to standard output [all, queries]\n"));
+	printf(_("  ECHO_HIDDEN        display internal queries executed by backslash commands\n"));
+	printf(_("  ENCODING           current client character set encoding\n"));
+	printf(_("  FETCH_COUNT        the number of result rows to fetch and display at a time\n"
+					 "                     (default: 0=unlimited)\n"));
+	printf(_("  HISTCONTROL        control history list [ignorespace, ignoredups, ignoreboth]\n"));
+	printf(_("  HISTFILE           file name used to store the history list\n"));
+	printf(_("  HISTSIZE           the number of commands to store in the command history\n"));
+	printf(_("  HOST               the currently connected database server\n"));
+	printf(_("  IGNOREEOF          if unset, sending an EOF to interactive session terminates application\n"));
+	printf(_("  LASTOID            the value of last affected OID\n"));
+	printf(_("  ON_ERROR_ROLLBACK  when on, the error doesn't break transaction (due implicit SAVEPOINs)\n"));
+	printf(_("  ON_ERROR_STOP      stop batch execution after error\n"));
+	printf(_("  PORT               the database server port\n"));
+	printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
+					 "                     specify the psql prompt\n"));
+	printf(_("  QUIET              run quietly (same as -q option)\n"));
+	printf(_("  SINGLELINE         end of line terminates SQL command mode (same as -S option)\n"));
+	printf(_("  SINGLESTEP         confirm each query mode (same as -s option)\n"));
+	printf(_("  USER               the database user currently connected as\n"));
+	printf(_("  VERBOSITY          control verbosity of error reports [default, verbose, terse]\n"));
+
+	printf(_("\nPrinting options:\n"));
+	printf(_("Usage:\n"));
+	printf(_("  psql --pset=NAME[=VALUE]\n  or \\pset NAME [VALUE] in interactive mode\n\n"));
+
+	printf(_("  border             border style (number)\n"));
+	printf(_("  columns            sets the target width for the wrapped format\n"));
+	printf(_("  expanded (or x)    toggle expanded output\n"));
+	printf(_("  fieldsep           field separator for unaligned output (default '|')\n"));
+	printf(_("  fieldsep_zero      set field separator in unaligned mode to zero\n"));
+	printf(_("  format             set output format [unaligned, aligned, wrapped, html, latex, ..]\n"));
+	printf(_("  footer             enable or disable display of the table foote [on, off]\n"));
+	printf(_("  linestyle          sets the border line drawing style [ascii, old-ascii, unicode]\n"));
+	printf(_("  null               sets the string to be printed in place of a null value\n"));
+	printf(_("  numericlocale      enable or disable display of a locale-specific character to separate\n"
+					 "                     groups digits [on, off]\n"));
+	printf(_("  pager              when the pager option is off, the pager program is not used\n"));
+	printf(_("  recordsep          specifies the record (line) separator to use in unaligned output format\n"));
+	printf(_("  recordsep_zero     record separator be in unaligned output format a zero byte\n"));
+	printf(_("  tableattr (or T)   specifies attributies for table tag in html format or proportional\n"
+					 "                     column width of left aligned data type in latex format\n"));
+	printf(_("  title              sets the table title for any subsequently printed tables\n"));
+	printf(_("  tuples_only        in tuples-only mode, only actual table data is shown\n"));
+
+	printf(_("\nEnvironment variables:\n"));
+	printf(_("Usage:\n"));
+	printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE] in interactive mode\n\n"));
+
+	printf(_("  COLUMNS            number of columns for wrapped format\n"));
+	printf(_("  PAGER              used pager\n"));
+	printf(_("  PGDATABASE         same as the dbname connection parameter\n"));
+	printf(_("  PGHOST             same as the host connection parameter\n"));
+	printf(_("  PGPORT             same as the port connection parameter\n"));
+	printf(_("  PGUSER             same as the user connection parameter\n"));
+	printf(_("  PGPASSWORD         possibility to set password (not recommended)\n"));
+	printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));
+	printf(_("  PSQL_EDITOR, EDITOR, VISUAL\n"
+					 "                     editor used by \\e \\ef commands\n"));
+	printf(_("  PSQL_EDITOR_LINE_NUMBER_ARG\n"
+					 "                     style how line number is used in editor\n"));
+	printf(_("  PSQL_HISTORY       alternative location for the command history file\n"));
+	printf(_("  PSQLRC             alternative location of the user's .psqlrc file\n"));
+	printf(_("  SHELL              command executed by the \\! command\n"));
+	printf(_("  TMPDIR             directory for storing temporary files\n"));
+
+	printf(_("\nFor more information consult the psql section in the PostgreSQL\n"
+			 "documentation.\n\n"));
+	printf(_("Report bugs to <pgsql-b...@postgresql.org>.\n"));
+}
+
 
 /*
  * helpSQL -- help with SQL commands
diff --git a/src/bin/psql/help.h b/src/bin/psql/help.h
index 054d5a4..e7affff 100644
--- a/src/bin/psql/help.h
+++ b/src/bin/psql/help.h
@@ -12,6 +12,8 @@ void		usage(void);
 
 void		slashUsage(unsigned short int pager);
 
+void		help_variables(void);
+
 void		helpSQL(const char *topic, unsigned short int pager);
 
 void		print_copyright(void);
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 45653a1..d911159 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -383,6 +383,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
 		{"expanded", no_argument, NULL, 'x'},
 		{"no-psqlrc", no_argument, NULL, 'X'},
 		{"help", no_argument, NULL, '?'},
+		{"help-variables", no_argument, NULL, 1},
 		{NULL, 0, NULL, 0}
 	};
 
@@ -566,6 +567,9 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
 					exit(EXIT_FAILURE);
 				}
 				break;
+			case 1:
+				help_variables();
+				exit(EXIT_SUCCESS);
 			default:
 				fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
 						pset.progname);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to