From: Benno Schulenberg <bensberg@telfort.nl>
To: util-linux@vger.kernel.org
Subject: [PATCH 2/3] textual: harmonize the messages for an invalid size, length, and offset
Date: Wed, 9 Jul 2025 11:07:33 +0200 [thread overview]
Message-ID: <20250709090734.18263-2-bensberg@telfort.nl> (raw)
In-Reply-To: <20250709090734.18263-1-bensberg@telfort.nl>
The added words "argument" or "value" or "specified" don't make things
clearer and are just unneeded verbosity. Also, use all lowercase.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
disk-utils/addpart.c | 2 +-
disk-utils/mkswap.c | 4 ++--
disk-utils/resizepart.c | 2 +-
misc-utils/blkid.c | 4 ++--
misc-utils/fadvise.c | 4 ++--
misc-utils/lsclocks.c | 2 +-
misc-utils/pipesz.c | 2 +-
misc-utils/wipefs.c | 2 +-
sys-utils/fallocate.c | 6 +++---
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/disk-utils/addpart.c b/disk-utils/addpart.c
index 6bdb33662..5f45bbc3a 100644
--- a/disk-utils/addpart.c
+++ b/disk-utils/addpart.c
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
if (partx_add_partition(fd,
strtou32_or_err(argv[2], _("invalid partition number argument")),
strtou64_or_err(argv[3], _("invalid start argument")),
- strtou64_or_err(argv[4], _("invalid length argument"))))
+ strtou64_or_err(argv[4], _("invalid length"))))
err(EXIT_FAILURE, _("failed to add partition"));
return EXIT_SUCCESS;
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 609ecadd0..3cb7a043b 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -641,10 +641,10 @@ int main(int argc, char **argv)
break;
case 'o':
ctl.offset = str2unum_or_err(optarg,
- 10, _("Invalid offset"), SINT_MAX(off_t));
+ 10, _("invalid offset"), SINT_MAX(off_t));
break;
case 's':
- ctl.filesz = strtosize_or_err(optarg, _("Invalid size"));
+ ctl.filesz = strtosize_or_err(optarg, _("invalid size"));
break;
case 'F':
ctl.file = 1;
diff --git a/disk-utils/resizepart.c b/disk-utils/resizepart.c
index e29021b37..798dd3079 100644
--- a/disk-utils/resizepart.c
+++ b/disk-utils/resizepart.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
wholedisk, argv[2]);
if (partx_resize_partition(fd, partno, start,
- strtou64_or_err(argv[3], _("invalid length argument"))))
+ strtou64_or_err(argv[3], _("invalid length"))))
err(EXIT_FAILURE, _("failed to resize partition"));
if (close_fd(fd) != 0)
diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
index 63e61b5fa..3960b0d97 100644
--- a/misc-utils/blkid.c
+++ b/misc-utils/blkid.c
@@ -813,7 +813,7 @@ int main(int argc, char **argv)
errx(BLKID_EXIT_OTHER, _("unsupported output format %s"), optarg);
break;
case 'O':
- ctl.offset = strtosize_or_err(optarg, _("invalid offset argument"));
+ ctl.offset = strtosize_or_err(optarg, _("invalid offset"));
break;
case 'p':
ctl.lowprobe_superblocks = 1;
@@ -826,7 +826,7 @@ int main(int argc, char **argv)
ctl.show[numtag++] = optarg;
break;
case 'S':
- ctl.size = strtosize_or_err(optarg, _("invalid size argument"));
+ ctl.size = strtosize_or_err(optarg, _("invalid size"));
break;
case 't':
if (search_type) {
diff --git a/misc-utils/fadvise.c b/misc-utils/fadvise.c
index abbc3a62d..da7fc691a 100644
--- a/misc-utils/fadvise.c
+++ b/misc-utils/fadvise.c
@@ -111,11 +111,11 @@ int main(int argc, char ** argv)
break;
case 'l':
len = strtosize_or_err(optarg,
- _("invalid length argument"));
+ _("invalid length"));
break;
case 'o':
offset = strtosize_or_err(optarg,
- _("invalid offset argument"));
+ _("invalid offset"));
break;
case 'V':
print_version(EXIT_SUCCESS);
diff --git a/misc-utils/lsclocks.c b/misc-utils/lsclocks.c
index 435894182..3fdec7ef2 100644
--- a/misc-utils/lsclocks.c
+++ b/misc-utils/lsclocks.c
@@ -266,7 +266,7 @@ static int64_t get_namespace_offset(const char *name)
space = strchr(line, ' ');
if (space)
*space = '\0';
- ret = strtos64_or_err(line, _("Invalid offset"));
+ ret = strtos64_or_err(line, _("invalid offset"));
break;
}
diff --git a/misc-utils/pipesz.c b/misc-utils/pipesz.c
index 0d1a2fc92..8a3da8612 100644
--- a/misc-utils/pipesz.c
+++ b/misc-utils/pipesz.c
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
opt_quiet = TRUE;
break;
case 's':
- sz = strtosize_or_err(optarg, _("invalid size argument"));
+ sz = strtosize_or_err(optarg, _("invalid size"));
opt_size = sz >= INT_MAX ? INT_MAX : (int)sz;
++n_opt_size;
break;
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index a215088a4..b712ce700 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -737,7 +737,7 @@ main(int argc, char **argv)
break;
case 'o':
add_offset(&ctl.offsets, strtosize_or_err(optarg,
- _("invalid offset argument")));
+ _("invalid offset")));
break;
case 'p':
ctl.parsable = 1;
diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index 7b65481cc..13bf52915 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -386,16 +386,16 @@ int main(int argc, char **argv)
if (length == -2LL)
length = 0;
if (length < 0)
- errx(EXIT_FAILURE, _("invalid length value specified"));
+ errx(EXIT_FAILURE, _("invalid length"));
} else {
/* it's safer to require the range specification (--length --offset) */
if (length == -2LL)
errx(EXIT_FAILURE, _("no length argument specified"));
if (length <= 0)
- errx(EXIT_FAILURE, _("invalid length value specified"));
+ errx(EXIT_FAILURE, _("invalid length"));
}
if (offset < 0)
- errx(EXIT_FAILURE, _("invalid offset value specified"));
+ errx(EXIT_FAILURE, _("invalid offset"));
/* O_CREAT makes sense only for the default fallocate(2) behavior
* when mode is no specified and new space is allocated */
--
2.48.2
next prev 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 ` Benno Schulenberg [this message]
2025-07-09 9:07 ` [PATCH 3/3] textual: harmonize the messages for invalid count and timeout values Benno Schulenberg
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-2-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