[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] [PATCH] xargs: better error message for xargs -s
Re: [Findutils-patches] [PATCH] xargs: better error message for xargs -s notanumber.
Sun, 24 Jan 2016 23:45:08 +0000
On Sun, Jan 24, 2016 at 10:19 PM, Bernhard Voelker
> Nice one!
Thanks, I pushed the patch.
> Nevertheless, the user will maybe still miss that line,
> because of the following big usage message.
> What about something like the following - shorter ?
> $ xargs/xargs -s ABC
> xargs/xargs: invalid number "ABC" for -s option
> Try 'xargs/xargs --help' for more information.
I like this idea. It directs the attention of the reader to the
actual problem. This is good for both beginners (it tells them what
they did wrong without things scrolling off-screen) and experts (who
don't need the usage message).
> The attached patch is a draft to do this (on top of your patch).
Two comments on the patch. One is major (i.e. I think we should
probably address it in the same change [or a cluster of changes]) and
the other minor (in a later change would certainly be OK).
1. Let's be consistent - if this approach to usage errors is correct,
let's apply it across all the programs.
2. usage() now no longer returns, can we portably signal this to the
compiler in a function attribute? See for example m4/noreturn.m4.