On 01/25/2016 12:45 AM, James Youngman wrote: > On Sun, Jan 24, 2016 at 10:19 PM, Bernhard Voelker > <m...@bernhard-voelker.de> 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, Berny