On Fri, Sep 19, 2025 at 11:40:51AM +0200, pourko--- via Bug reports for the GNU
Bourne Again SHell wrote:
> Wouldn't it be more reasonable to return 0 when invoking
> builtin_name --help
> the way most external commands do?
> (Unless there's actually an error.)
>
Playing the devil's advocate here...at least in part.
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, but the fact that they *also* output help text seems like a
bug to me. To get the help text, one should use "help builtin_name"
(this also works for built-ins like "[" and "echo" that do not recognize
"--help"). This is the point of the "help" built-in.
--
Matti Andreas Kähäri
Uppsala, Sweden
.