Util-Linux package development
 help / color / mirror / Atom feed
From: Benno Schulenberg <bensberg@telfort.nl>
To: util-linux@vger.kernel.org
Subject: [PATCH 3/3] textual: harmonize the messages for invalid count and timeout values
Date: Wed,  9 Jul 2025 11:07:34 +0200	[thread overview]
Message-ID: <20250709090734.18263-3-bensberg@telfort.nl> (raw)
In-Reply-To: <20250709090734.18263-1-bensberg@telfort.nl>

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
 login-utils/sulogin.c | 2 +-
 misc-utils/findmnt.c  | 2 +-
 misc-utils/uuidgen.c  | 2 +-
 misc-utils/waitpid.c  | 5 ++---
 sys-utils/flock.c     | 3 +--
 sys-utils/wdctl.c     | 4 ++--
 term-utils/agetty.c   | 2 +-
 term-utils/wall.c     | 4 ++--
 8 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 0de850508..eb4609db6 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -1037,7 +1037,7 @@ int main(int argc, char **argv)
 	while ((c = getopt_long(argc, argv, "ehpt:V", longopts, NULL)) != -1) {
 		switch(c) {
 		case 't':
-			timeout = strtou32_or_err(optarg, _("invalid timeout argument"));
+			timeout = strtou32_or_err(optarg, _("invalid timeout"));
 			break;
 		case 'p':
 			profile = 1;
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index ee9371e69..31350df78 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -1998,7 +1998,7 @@ int main(int argc, char *argv[])
 			findmnt.flags |= FL_UNIQ;
 			break;
 		case 'w':
-			timeout = strtos32_or_err(optarg, _("invalid timeout argument"));
+			timeout = strtos32_or_err(optarg, _("invalid timeout"));
 			break;
 		case 'x':
 			verify = 1;
diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index 6133cb0eb..8e07cdb65 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -147,7 +147,7 @@ main (int argc, char *argv[])
 			do_type = UUID_TYPE_DCE_MD5;
 			break;
 		case 'C':
-			count = strtou32_or_err(optarg, _("invalid count argument"));
+			count = strtou32_or_err(optarg, _("invalid count"));
 			break;
 		case 's':
 			do_type = UUID_TYPE_DCE_SHA1;
diff --git a/misc-utils/waitpid.c b/misc-utils/waitpid.c
index f108206a9..b63532790 100644
--- a/misc-utils/waitpid.c
+++ b/misc-utils/waitpid.c
@@ -197,14 +197,13 @@ static int parse_options(int argc, char **argv)
 			verbose = true;
 			break;
 		case 't':
-			strtotimespec_or_err(optarg, &timeout,
-					     _("Could not parse timeout"));
+			strtotimespec_or_err(optarg, &timeout,  _("invalid timeout"));
 			break;
 		case 'e':
 			allow_exited = true;
 			break;
 		case 'c':
-			count = str2num_or_err(optarg, 10, _("Invalid count"),
+			count = str2num_or_err(optarg, 10, _("invalid count"),
 					       1, INT64_MAX);
 			break;
 		case 'V':
diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 6e58a1d51..fe1a71f72 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -273,8 +273,7 @@ int main(int argc, char *argv[])
 			break;
 		case 'w':
 			have_timeout = 1;
-			strtotimeval_or_err(optarg, &timeout.it_value,
-				_("invalid timeout value"));
+			strtotimeval_or_err(optarg, &timeout.it_value, _("invalid timeout"));
 			break;
 		case 'E':
 			conflict_exit_code = strtos32_or_err(optarg,
diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index b3203d461..f3ae0e3f8 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -792,11 +792,11 @@ int main(int argc, char *argv[])
 				return EXIT_FAILURE;
 			break;
 		case 's':
-			ctl.timeout = strtos32_or_err(optarg, _("invalid timeout argument"));
+			ctl.timeout = strtos32_or_err(optarg, _("invalid timeout"));
 			ctl.set_timeout = 1;
 			break;
 		case 'p':
-			ctl.pretimeout = strtos32_or_err(optarg, _("invalid pretimeout argument"));
+			ctl.pretimeout = strtos32_or_err(optarg, _("invalid pretimeout"));
 			ctl.set_pretimeout = 1;
 			break;
 		case 'f':
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index f65e511ca..5e564c4f0 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -852,7 +852,7 @@ static void parse_args(int argc, char **argv, struct options *op)
 			op->flags |= F_KEEPSPEED;
 			break;
 		case 't':
-			op->timeout = strtou32_or_err(optarg,  _("invalid timeout argument"));
+			op->timeout = strtou32_or_err(optarg,  _("invalid timeout"));
 			break;
 		case 'U':
 			op->flags |= F_LCUC;
diff --git a/term-utils/wall.c b/term-utils/wall.c
index 293275cb3..1152a1222 100644
--- a/term-utils/wall.c
+++ b/term-utils/wall.c
@@ -240,9 +240,9 @@ int main(int argc, char **argv)
 				warnx(_("--nobanner is available only for root"));
 			break;
 		case 't':
-			timeout = strtou32_or_err(optarg, _("invalid timeout argument"));
+			timeout = strtou32_or_err(optarg, _("invalid timeout"));
 			if (timeout < 1)
-				errx(EXIT_FAILURE, _("invalid timeout argument: %s"), optarg);
+				errx(EXIT_FAILURE, _("invalid timeout: %s"), optarg);
 			break;
 		case 'g':
 			group_buf = init_group_workspace(optarg);
-- 
2.48.2


  parent reply	other threads:[~2025-07-09  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09  9:07 [PATCH 1/3] column: call gettext() on an error message only when it gets printed Benno Schulenberg
2025-07-09  9:07 ` [PATCH 2/3] textual: harmonize the messages for an invalid size, length, and offset Benno Schulenberg
2025-07-09  9:07 ` Benno Schulenberg [this message]
2025-07-16  8:17 ` [PATCH 1/3] column: call gettext() on an error message only when it gets printed Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250709090734.18263-3-bensberg@telfort.nl \
    --to=bensberg@telfort.nl \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox