[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.
Tue, 26 Jan 2016 00:11:19 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
On 01/25/2016 12:45 AM, James Youngman wrote:
> On Sun, Jan 24, 2016 at 10:19 PM, Bernhard Voelker
> <address@hidden> wrote:
>> 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.
Thanks for confirming. I'll come up with a patch in a couple of days
(I'm on a business trip right now).
Thanks & have a nice day,