summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2020-04-03 23:48:07 +0000
committerMark Wong <mark@2ndQuadrant.com>2020-04-04 03:03:46 +0000
commitdf22c1dba02aa7acb9ec62a61c22711761ceec46 (patch)
tree39151b5f3128b4bd99eea89f7526301a6663e9ea
parente2a0ec144120cf61cd946d39be7a266ae4142281 (diff)
Fix command line handling of display counts
With minor updates in usage() output to match the command line text with the options test.
-rw-r--r--HISTORY2
-rw-r--r--pg_top.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 73d7f8d..d59f06e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -18,6 +18,8 @@ Release 4.0.0
* Show swapping activity
* Simplify top I/O display
* Remove toggle for display raw I/O statistics
+ * Fix bug for specifing number of displays to show on the command line
+ without -x flag
Release 3.7.0
diff --git a/pg_top.c b/pg_top.c
index 5655719..71df05e 100644
--- a/pg_top.c
+++ b/pg_top.c
@@ -135,8 +135,8 @@ usage(const char *progname)
{
printf("%s monitors a PostgreSQL database cluster.\n\n", progname);
printf("Usage:\n");
- printf(" %s [OPTION]... [NUMBER]\n", progname);
- printf("\nOptions:\n");
+ printf(" %s [OPTION]... [COUNT]\n", progname);
+ printf("\nGeneral options:\n");
printf(" -b, --batch use batch mode\n");
printf(" -c, --show-command display command name of each process\n");
printf(" -C, --color-mode turn off color mode\n");
@@ -770,7 +770,7 @@ main(int argc, char *argv[])
}
else
{
- pgtctx.topn = i;
+ pgtctx.displays = i;
}
}