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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux