A propose to revise \watch help message

Started by Kyotaro Horiguchiover 2 years ago2 messages
#1Kyotaro Horiguchi
horikyota.ntt@gmail.com
1 attachment(s)

Recently \watch got the following help message.

\watch [[i=]SEC] [c=N] [m=MIN]
execute query every SEC seconds, up to N times
stop if less than MIN rows are returned

The "m=MIN" can be a bit misleading. It may look like it's about
interval or counts, but it actually refers to the row number, which is
not spelled out in the line.

Would it make sense to change it to MINROWS? There's enough room in
the line for that change and the doc already uses min_rows.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

watch_help_MIN_to_MINROWS.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 38c165a627..8c8616205d 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -200,9 +200,9 @@ slashUsage(unsigned short int pager)
 	HELP0("  \\gset [PREFIX]         execute query and store result in psql variables\n");
 	HELP0("  \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n");
 	HELP0("  \\q                     quit psql\n");
-	HELP0("  \\watch [[i=]SEC] [c=N] [m=MIN]\n");
+	HELP0("  \\watch [[i=]SEC] [c=N] [m=MINROWS]\n");
 	HELP0("                          execute query every SEC seconds, up to N times\n");
-	HELP0("                          stop if less than MIN rows are returned\n");
+	HELP0("                          stop if less than MINROWS rows are returned\n");
 	HELP0("\n");
 
 	HELP0("Help\n");
#2Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Kyotaro Horiguchi (#1)
1 attachment(s)
Re: A propose to revise \watch help message

At Wed, 30 Aug 2023 10:21:26 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in

Recently \watch got the following help message.

\watch [[i=]SEC] [c=N] [m=MIN]
execute query every SEC seconds, up to N times
stop if less than MIN rows are returned

The "m=MIN" can be a bit misleading. It may look like it's about
interval or counts, but it actually refers to the row number, which is
not spelled out in the line.

Would it make sense to change it to MINROWS? There's enough room in
the line for that change and the doc already uses min_rows.

Mmm. I noticed the continuation lines are indented too much, probably
because of the backslash escape in the main line. The attached
includes the fix for that.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

watch_help_MIN_to_MINROWS_2.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 38c165a627..2da79a75f5 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -200,9 +200,9 @@ slashUsage(unsigned short int pager)
 	HELP0("  \\gset [PREFIX]         execute query and store result in psql variables\n");
 	HELP0("  \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n");
 	HELP0("  \\q                     quit psql\n");
-	HELP0("  \\watch [[i=]SEC] [c=N] [m=MIN]\n");
-	HELP0("                          execute query every SEC seconds, up to N times\n");
-	HELP0("                          stop if less than MIN rows are returned\n");
+	HELP0("  \\watch [[i=]SEC] [c=N] [m=MINROWS]\n");
+	HELP0("                         execute query every SEC seconds, up to N times\n");
+	HELP0("                         stop if less than MINROWS rows are returned\n");
 	HELP0("\n");
 
 	HELP0("Help\n");