Re: [PATCH 3/4] chrt: simplify the other check for too few arguments

Benno Schulenberg <[email protected]> Wed, 2 Jul 2025 15:39:53 +0200
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
Op 02-07-2025 om 11:01 schreef Karel Zak:
> On Tue, Jul 01, 2025 at 03:39:57PM +0200, Benno Schulenberg wrote:
>> The reason I don't want to see "Try 'chrt --help' for more information."
>> when I make a mistake is that it means that I have to read two lines:
> 
> We should be consistent. The `errtryhelp()` function is usually used as the
> default error for an unknown option or when the user is "lost" on the command
> line, for example, if not all required arguments are used.
> 
>    warnx(_("too few arguments"));
>    errtryhelp(EXIT_FAILURE);
> 
> (or "bad usage") is consistent with the rest of util-linux.

After grepping for -B1 errtryhelp, I now see that this is the style
in the util-linux tools.  I'm sorry to realize that.  :/

>> the
>> second line doesn't add any information -- it just states the obvious.
> 
> It does not have to be obvious to all users, -? -h, -H, --help, sometimes
> nothing, etc.

As far as I can tell, all the util-linux tools understand --help.
So, for util-linux tools, it is rather redundant to tell the user
this.

(There are just three tools that don't understand the short form
-h for help: agettty, col, and setttetm.  fsck does not officially
support -h, but prints a help text anyway, from e2fsprogs.)


Benno
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmhlNqkFAwAAAAAACgkQUUu+Lrjhlh8T
fRAAqxFt+Too5FRHMhRz40dl/HVuR6e4WA7H1MT1dIxF8whpe71387nd//DLiWUO4QBlOtR8ePWR
7brsUtAXhIKvpePg2b+9CmAItU3vGhteQ6tNOTPlysN0ZHpUMuryFmyWZEtjLyK/q5wQ5l69JnU+
jvaxMSEttQ9N2H6+niSH4fztXDds9n+5bwhYY0y2ALgyEIK5gqkMht2nyrW6lgs57K38fooLiWhJ
nPhQyYrWUFIM2r6psMjX7ZmQfS9MRce4pdrxIL6+BhOxs9UlpDDMalWfjIAjIm86UsbvMQhhrAHE
RP4qmovQ01MmqNhQIes2a/K8jykv/0O02hZ/lbux9gbr1HSp2U68ASfLq5EMXqOy98QRU7fOdauc
sQwgGT2Dek0KNiVUCiVikowsl2wiSq8GKKMJlX5Z77uNrcwU9Ditv0SyG9FHH4daerMc8x0/btJn
ni4Qn/V5n05Vz0ISRADJIWtizL1z8QcWBnR0tX5KaHSsdw4zu3+ZvU41yAyOlVY9Xdp5BFu8YIzm
AqEfwqRPnWnFblH3l5KYbgQTe6zBcUqmR0lMCTSxcNW7PlDQ04sWclbZH2KXl7cA6WxjZjGjE5MH
nRV2hUBz8A5QOy7/5z3WCm2BxS36UNu91pVzegUqvAJRTG96gEFTjXY2QMWhXnT4oD7/eKWGaITP
ERY=
=I0Y2
-----END PGP SIGNATURE-----