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 13:26:18 +0200

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

.



reply via email to

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