Je Thu, Feb 20, 2025 at 08:29:19AM -0500, Greg Wooledge skribis:
> On Thu, Feb 20, 2025 at 21:25:45 +0900, Koichi Murase wrote:
> > $ bash --pretty-print -O extglob test.sh
> 
> Yeah, I misread the question a little bit.  Sorry about that.
> 
> By the way, is this considered a bug:
> 
> 
> hobbit:~$ bash -O extglob --pretty-print x
> bash: --: invalid option
> Usage:        bash [GNU long option] [option] ...
>       bash [GNU long option] [option] script-file ...
> GNU long options:
> [...]
> 
> 
> The --pretty-print option works if it's first, but not if it comes
> after the -O extglob.

The shown synopsis is fairly clear.  Long options should be given first,
then short options.

This is also mentioned in the manual:

        Bash also interprets a number of multi-character options.
        These options must appear on the command line before the
        single-character options to be recognized.


-- 
Andreas (Kusalananda) Kähäri
Uppsala, Sweden

.

Reply via email to