]> git.ipfire.org Git - thirdparty/util-linux.git/commit
strutils: move an error message to where it is used, and improve it
authorBenno Schulenberg <bensberg@telfort.nl>
Fri, 2 May 2025 12:22:42 +0000 (14:22 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 5 May 2025 08:45:15 +0000 (10:45 +0200)
commit145085292aa06e31068dc05cd56b42e42773bf47
tree72bd070a3006d719e32065a7d0eb4ca826449113
parent6b3687403a35a20e304fbdfb6e345775a7c8ec57
strutils: move an error message to where it is used, and improve it

Calling gettext() is somewhat costly: it has to find the given message
among the more than five thousand messages in util-linux's repertoire.
So, call gettext() only when the message actually gets printed.

Besides, allowing to customize the error message for parse_switch() was
a nice gesture, but it's unneeded: a fixed error message is good enough.

Also, "argument error" was rather vague, as it doesn't say _what_ the
error is.  Better say "unsupported argument".

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
include/strutils.h
lib/strutils.c
sys-utils/eject.c
sys-utils/irqtop.c
sys-utils/losetup.c
sys-utils/tunelp.c
term-utils/setterm.c