bug-bash
[Top][All Lists]
Advanced

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

Re: builtin_name --help


From: Andreas Kähäri
Subject: Re: builtin_name --help
Date: Fri, 19 Sep 2025 16:13:59 +0200

On Fri, Sep 19, 2025 at 03:55:14PM +0200, pourko--- via Bug reports for the GNU 
Bourne Again SHell wrote:
> Sep 19, 2025, 06:26 by andreas.kahari@abc.se:
> > On Fri, Sep 19, 2025 at 11:40:51AM +0200, Pourko wrote:
> > The bug here seems to be that the "--help" long option provokes a
> > behaviour from some built-ins that is not documented.  The built-ins
> > that do this are rightly exiting with status 2, since an invalid option
> > was given,
> 
> Not *some*, they all return error code 2. 
> And, I don't see anything "invalid" about --help.
> 
> > the fact that they *also* output help text seems like a bug to me.
> 
> No, the fact that they output help text is because "--help" was asked for,
> and they do support "--help".

Support?  I would expect that to be documented.  If a utility does not
document an option, how can I be sure what would happen if I used it?

Should I somehow *assume* that "--help" is supported?

> 
> > (this also works for built-ins like "[" and "echo" that do not recognize
> > "--help").
> 
> Then maybe they should. Both /bin/[ and /bin/echo support "--help".
> 

Well, that would surely depend on the OS and its base system tooling,
wouldn't it?

        $ /bin/[ --help
        [: missing ]
        $ /bin/echo --help
        --help

-- 
Matti Andreas Kähäri
Uppsala, Sweden

.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]