The <replaceable class="parameter">value</replaceable> must be a
number. In general, the higher
the number the more borders and lines the tables will have,
- but this depends on the particular format. In
- <acronym>HTML</acronym> format, this will translate directly
- into the <literal>border=...</literal> attribute; in
- <literal>latex</literal> and <literal>latex-longtable</literal>
- formats, a value of 3 will add a dividing line between each row; in
- the other formats only values 0 (no border), 1 (internal dividing
- lines), and 2 (table frame) make sense and values above 2 will be
- treated the same as <literal>border = 2</literal>.
+ but details depend on the particular format.
+ In <acronym>HTML</acronym> format, this will translate directly
+ into the <literal>border=...</literal> attribute.
+ In most other formats only values 0 (no border), 1 (internal
+ dividing lines), and 2 (table frame) make sense, and values above 2
+ will be treated the same as <literal>border = 2</literal>.
+ The <literal>latex</literal> and <literal>latex-longtable</literal>
+ formats additionally allow a value of 3 to add dividing lines
+ between data rows.
</para>
</listitem>
</varlistentry>
<para>
When the <literal>border</> setting is greater than zero,
- this option also determines the characters
- with which the border lines are drawn.
+ the <literal>linestyle</literal> option also determines the
+ characters with which the border lines are drawn.
Plain <acronym>ASCII</acronym> characters work everywhere, but
Unicode characters look nicer on displays that recognize them.
</para>
</varlistentry>
<varlistentry>
- <term><literal>unicode_border_style</literal></term>
+ <term><literal>unicode_border_linestyle</literal></term>
<listitem>
<para>
- Sets the border drawing style for the <literal>unicode</literal> line style to one
- of <literal>single</literal> or <literal>double</literal>.
+ Sets the border drawing style for the <literal>unicode</literal>
+ line style to one of <literal>single</literal>
+ or <literal>double</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><literal>unicode_column_style</literal></term>
+ <term><literal>unicode_column_linestyle</literal></term>
<listitem>
<para>
- Sets the column drawing style for the <literal>unicode</literal> line style to one
- of <literal>single</literal> or <literal>double</literal>.
+ Sets the column drawing style for the <literal>unicode</literal>
+ line style to one of <literal>single</literal>
+ or <literal>double</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><literal>unicode_header_style</literal></term>
+ <term><literal>unicode_header_linestyle</literal></term>
<listitem>
<para>
- Sets the header drawing style for the <literal>unicode</literal> line style to one
- of <literal>single</literal> or <literal>double</literal>.
+ Sets the header drawing style for the <literal>unicode</literal>
+ line style to one of <literal>single</literal>
+ or <literal>double</literal>.
</para>
</listitem>
</varlistentry>
2014-09-12 [a2dabf0] Stephe..: Add unicode_{column|header|border}_style to psql
-->
<para>
- Allow column, header, and border control to <application>psql</>'s
- Unicode style (Pavel Stehule)
+ Provide separate column, header, and border linestyle control
+ in <application>psql</>'s unicode linestyle (Pavel Stehule)
</para>
<para>
- Single or double output is supported; the default is
+ Single or double lines are supported; the default is
<literal>single</>.
</para>
</listitem>
}
/*
- * Parse entered unicode linestyle. Returns true, when entered string is
- * known linestyle: single, double else returns false.
+ * Parse entered unicode linestyle. If ok, update *linestyle and return
+ * true, else return false.
*/
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)
{
if (pg_strncasecmp("single", value, vallen) == 0)
*linestyle = UNICODE_LINESTYLE_DOUBLE;
else
return false;
-
- /* input is ok, generate new unicode style */
- refresh_utf8format(&(popt->topt));
-
return true;
}
{
if (!value)
;
- else if (!set_unicode_line_style(popt, value, vallen,
- &popt->topt.unicode_border_linestyle))
+ else if (set_unicode_line_style(value, vallen,
+ &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;
}
}
{
if (!value)
;
- else if (!set_unicode_line_style(popt, value, vallen,
- &popt->topt.unicode_column_linestyle))
+ else if (set_unicode_line_style(value, vallen,
+ &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;
}
}
{
if (!value)
;
- else if (!set_unicode_line_style(popt, value, vallen,
- &popt->topt.unicode_header_linestyle))
+ else if (set_unicode_line_style(value, vallen,
+ &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;
}
}
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));
}