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 [email protected]:
> > 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

.

  • Re: builtin_name ... Andreas Kähäri
    • Re: builtin_... pourko--- via Bug reports for the GNU Bourne Again SHell
      • Re: buil... Chet Ramey
        • Re: ... pourko--- via Bug reports for the GNU Bourne Again SHell
          • ... Chet Ramey
            • ... pourko--- via Bug reports for the GNU Bourne Again SHell
              • ... Chet Ramey
              • ... pourko--- via Bug reports for the GNU Bourne Again SHell
              • ... Chet Ramey
              • ... Andreas Kähäri
      • Re: buil... Andreas Kähäri
        • Re: ... Chet Ramey
          • ... Andreas Kähäri
            • ... Chet Ramey
        • Re: ... pourko--- via Bug reports for the GNU Bourne Again SHell
          • ... Chet Ramey
    • Re: builtin_... Chet Ramey
      • Re: buil... Lawrence Velázquez
        • Re: ... Chet Ramey
          • ... pourko--- via Bug reports for the GNU Bourne Again SHell
            • ... Chet Ramey

Reply via email to