mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Code + docs review for unicode linestyle patch.
Fix some brain fade in commit a2dabf0e1dda93c8: erroneous variable names in docs, rearrangements that made sentences less clear not more so, undocumented and poorly-chosen-anyway API behaviors of subroutines, bad grammar in error messages, copy-and-paste faults. Albe Laurenz and Tom Lane
This commit is contained in:
parent
4efe26cbd3
commit
a69b0b2c14
@ -2038,14 +2038,15 @@ lo_import 152801
|
|||||||
The <replaceable class="parameter">value</replaceable> must be a
|
The <replaceable class="parameter">value</replaceable> must be a
|
||||||
number. In general, the higher
|
number. In general, the higher
|
||||||
the number the more borders and lines the tables will have,
|
the number the more borders and lines the tables will have,
|
||||||
but this depends on the particular format. In
|
but details depend on the particular format.
|
||||||
<acronym>HTML</acronym> format, this will translate directly
|
In <acronym>HTML</acronym> format, this will translate directly
|
||||||
into the <literal>border=...</literal> attribute; in
|
into the <literal>border=...</literal> attribute.
|
||||||
<literal>latex</literal> and <literal>latex-longtable</literal>
|
In most other formats only values 0 (no border), 1 (internal
|
||||||
formats, a value of 3 will add a dividing line between each row; in
|
dividing lines), and 2 (table frame) make sense, and values above 2
|
||||||
the other formats only values 0 (no border), 1 (internal dividing
|
will be treated the same as <literal>border = 2</literal>.
|
||||||
lines), and 2 (table frame) make sense and values above 2 will be
|
The <literal>latex</literal> and <literal>latex-longtable</literal>
|
||||||
treated the same as <literal>border = 2</literal>.
|
formats additionally allow a value of 3 to add dividing lines
|
||||||
|
between data rows.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -2220,8 +2221,8 @@ lo_import 152801
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
When the <literal>border</> setting is greater than zero,
|
When the <literal>border</> setting is greater than zero,
|
||||||
this option also determines the characters
|
the <literal>linestyle</literal> option also determines the
|
||||||
with which the border lines are drawn.
|
characters with which the border lines are drawn.
|
||||||
Plain <acronym>ASCII</acronym> characters work everywhere, but
|
Plain <acronym>ASCII</acronym> characters work everywhere, but
|
||||||
Unicode characters look nicer on displays that recognize them.
|
Unicode characters look nicer on displays that recognize them.
|
||||||
</para>
|
</para>
|
||||||
@ -2364,31 +2365,34 @@ lo_import 152801
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>unicode_border_style</literal></term>
|
<term><literal>unicode_border_linestyle</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Sets the border drawing style for the <literal>unicode</literal> line style to one
|
Sets the border drawing style for the <literal>unicode</literal>
|
||||||
of <literal>single</literal> or <literal>double</literal>.
|
line style to one of <literal>single</literal>
|
||||||
|
or <literal>double</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>unicode_column_style</literal></term>
|
<term><literal>unicode_column_linestyle</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Sets the column drawing style for the <literal>unicode</literal> line style to one
|
Sets the column drawing style for the <literal>unicode</literal>
|
||||||
of <literal>single</literal> or <literal>double</literal>.
|
line style to one of <literal>single</literal>
|
||||||
|
or <literal>double</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>unicode_header_style</literal></term>
|
<term><literal>unicode_header_linestyle</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Sets the header drawing style for the <literal>unicode</literal> line style to one
|
Sets the header drawing style for the <literal>unicode</literal>
|
||||||
of <literal>single</literal> or <literal>double</literal>.
|
line style to one of <literal>single</literal>
|
||||||
|
or <literal>double</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -2061,12 +2061,12 @@ FIXME: Add more specifics?
|
|||||||
2014-09-12 [a2dabf0] Stephe..: Add unicode_{column|header|border}_style to psql
|
2014-09-12 [a2dabf0] Stephe..: Add unicode_{column|header|border}_style to psql
|
||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
Allow column, header, and border control to <application>psql</>'s
|
Provide separate column, header, and border linestyle control
|
||||||
Unicode style (Pavel Stehule)
|
in <application>psql</>'s unicode linestyle (Pavel Stehule)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Single or double output is supported; the default is
|
Single or double lines are supported; the default is
|
||||||
<literal>single</>.
|
<literal>single</>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -2415,11 +2415,11 @@ _align2string(enum printFormat in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse entered unicode linestyle. Returns true, when entered string is
|
* Parse entered unicode linestyle. If ok, update *linestyle and return
|
||||||
* known linestyle: single, double else returns false.
|
* true, else return false.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
set_unicode_line_style(printQueryOpt *popt, const char *value, size_t vallen,
|
set_unicode_line_style(const char *value, size_t vallen,
|
||||||
unicode_linestyle *linestyle)
|
unicode_linestyle *linestyle)
|
||||||
{
|
{
|
||||||
if (pg_strncasecmp("single", value, vallen) == 0)
|
if (pg_strncasecmp("single", value, vallen) == 0)
|
||||||
@ -2428,10 +2428,6 @@ set_unicode_line_style(printQueryOpt *popt, const char *value, size_t vallen,
|
|||||||
*linestyle = UNICODE_LINESTYLE_DOUBLE;
|
*linestyle = UNICODE_LINESTYLE_DOUBLE;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* input is ok, generate new unicode style */
|
|
||||||
refresh_utf8format(&(popt->topt));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2517,10 +2513,12 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
|
|||||||
{
|
{
|
||||||
if (!value)
|
if (!value)
|
||||||
;
|
;
|
||||||
else if (!set_unicode_line_style(popt, value, vallen,
|
else if (set_unicode_line_style(value, vallen,
|
||||||
&popt->topt.unicode_border_linestyle))
|
&popt->topt.unicode_border_linestyle))
|
||||||
|
refresh_utf8format(&(popt->topt));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
psql_error("\\pset: allowed unicode border linestyle are single, double\n");
|
psql_error("\\pset: allowed unicode border linestyles are single, double\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2530,10 +2528,12 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
|
|||||||
{
|
{
|
||||||
if (!value)
|
if (!value)
|
||||||
;
|
;
|
||||||
else if (!set_unicode_line_style(popt, value, vallen,
|
else if (set_unicode_line_style(value, vallen,
|
||||||
&popt->topt.unicode_column_linestyle))
|
&popt->topt.unicode_column_linestyle))
|
||||||
|
refresh_utf8format(&(popt->topt));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
psql_error("\\pset: allowed unicode column linestyle are single, double\n");
|
psql_error("\\pset: allowed unicode column linestyles are single, double\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2543,10 +2543,12 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
|
|||||||
{
|
{
|
||||||
if (!value)
|
if (!value)
|
||||||
;
|
;
|
||||||
else if (!set_unicode_line_style(popt, value, vallen,
|
else if (set_unicode_line_style(value, vallen,
|
||||||
&popt->topt.unicode_header_linestyle))
|
&popt->topt.unicode_header_linestyle))
|
||||||
|
refresh_utf8format(&(popt->topt));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
psql_error("\\pset: allowed unicode header linestyle are single, double\n");
|
psql_error("\\pset: allowed unicode header linestyles are single, double\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2871,7 +2873,7 @@ printPsetInfo(const char *param, struct printQueryOpt *popt)
|
|||||||
|
|
||||||
else if (strcmp(param, "unicode_header_linestyle") == 0)
|
else if (strcmp(param, "unicode_header_linestyle") == 0)
|
||||||
{
|
{
|
||||||
printf(_("Unicode border linestyle is \"%s\".\n"),
|
printf(_("Unicode header linestyle is \"%s\".\n"),
|
||||||
_unicode_linestyle2string(popt->topt.unicode_header_linestyle));
|
_unicode_linestyle2string(popt->topt.unicode_header_linestyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user