Use --compact option for abbreviated display output

--terse is meant for reducing log chatter.
This commit is contained in:
Ian Barwick
2019-02-02 13:05:39 +09:00
parent 20b79f998c
commit 48381a5b4e
7 changed files with 25 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
4.3 2019-??
repmgr: add "daemon (start|stop)" command; GitHub #528 (Ian)
repmgr: add --version-number command line option (Ian)
repmgr: add --terse option to "cluster show"; GitHub #521 (Ian)
repmgr: add --compact option to "cluster show"; GitHub #521 (Ian)
repmgr: add --dry-run option to "standby promote"; GitHub #522 (Ian)
repmgr: add "node check --data-directory-config"; GitHub #523 (Ian)
repmgr: prevent potential race condition in "standby switchover"

View File

@@ -81,7 +81,7 @@ REPMGRD_OPTS="--daemonize=false"</programlisting>
<listitem>
<para>
Add <option>--terse</option> option to <command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command> (GitHub #521).
Add <option>--compact</option> option to <command><link linkend="repmgr-cluster-show">repmgr cluster show</link></command> (GitHub #521).
</para>
<para>
This makes it easier to copy the output into emails, chats etc. as a compact table.

View File

@@ -121,7 +121,7 @@
</varlistentry>
<varlistentry>
<term><option>--terse</option></term>
<term><option>--compact</option></term>
<listitem>
<para>
Suppress display of the <literal>conninfo</literal> column.
@@ -129,6 +129,15 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>--terse</option></term>
<listitem>
<para>
Suppress warnings about connection issues.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--verbose</option></term>
<listitem>

View File

@@ -120,7 +120,7 @@ do_cluster_show(void)
{
headers_show[i].display = true;
if (runtime_options.terse == true)
if (runtime_options.compact == true)
{
if (i == SHOW_CONNINFO)
{
@@ -361,7 +361,7 @@ do_cluster_show(void)
for (i = 0; i < SHOW_HEADER_COUNT; i++)
{
if (runtime_options.terse == true)
if (runtime_options.compact == true)
{
if (headers_show[i].display == false)
continue;
@@ -1518,6 +1518,7 @@ do_cluster_help(void)
printf(_(" Configuration file or database connection required.\n"));
puts("");
printf(_(" --csv emit output as CSV (with a subset of fields)\n"));
printf(_(" --compact display only a subset of fields\n"));
puts("");
printf(_("CLUSTER MATRIX\n"));

View File

@@ -44,6 +44,7 @@ typedef struct
char pg_bindir[MAXLEN]; /* overrides setting in repmgr.conf */
int wait;
bool no_wait;
bool compact;
/* logging options */
char log_level[MAXLEN]; /* overrides setting in repmgr.conf */
@@ -140,7 +141,7 @@ typedef struct
/* configuration metadata */ \
false, false, false, false, false, \
/* general configuration options */ \
"", false, false, "", -1, false, \
"", false, false, "", -1, false, false, \
/* logging options */ \
"", false, false, false, false, \
/* output options */ \

View File

@@ -267,6 +267,12 @@ main(int argc, char **argv)
runtime_options.no_wait = true;
break;
/* --compact */
case OPT_COMPACT:
runtime_options.compact = true;
break;
/*----------------------------
* database connection options
*----------------------------

View File

@@ -96,6 +96,7 @@
#define OPT_REPMGRD_NO_PAUSE 1042
#define OPT_VERSION_NUMBER 1043
#define OPT_DATA_DIRECTORY_CONFIG 1044
#define OPT_COMPACT 1045
/* deprecated since 3.3 */
@@ -118,6 +119,7 @@ static struct option long_options[] =
{"pg_bindir", required_argument, NULL, 'b'},
{"wait", optional_argument, NULL, 'w'},
{"no-wait", no_argument, NULL, 'W'},
{"compact", no_argument, NULL, OPT_COMPACT},
/* connection options */
{"dbname", required_argument, NULL, 'd'},