Skip to content

Doesn't appear to work with MacOS "brew" port of bash #17

Open
@fdx-apdewis

Description

@fdx-apdewis

I've tried running one of the tutorial scripts and it does not successfully parse options on MacOS via "homebrew" installation of Bash version 5.2.37, however it does on an ubuntu VM which has bash 5.1.16.

I'm not sure if this is an issue with Bash 5.2.37 or Mac homebrew build specifically at this time. Happy to provide other details as needed. Thanks.

#MacOS screenshot
Image

#Ubuntu

Image

Activity

Anvil

Anvil commented on Apr 13, 2025

@Anvil
Owner

Thanks for the report, I'll dig into that.

Anvil

Anvil commented on Apr 13, 2025

@Anvil
Owner

I cannot reproduce it on fedora 42 with bash 5.2.37

[anvil@krampouz ~/git/bash-argsparse]# bash tutorial/1-basics -o 1
Options reporting:
option2	: yes (1)
option3	: no
option1	: no
option4	: no
help   	: no
End of argsparse report.

option1 was not on the command line.
option2 was set 1 time(s) on the command line.
option3 was not on the command line.
option4 was not on the command line.

Parameter #1: 1
GNU bash, version 5.2.37(1)-release (x86_64-redhat-linux-gnu)

My guess right now is that you're not using GNU getopt. Can you confirm?

self-assigned this
on Apr 13, 2025
fdx-apdewis

fdx-apdewis commented on Apr 15, 2025

@fdx-apdewis
Author

I cannot reproduce it on fedora 42 with bash 5.2.37

[anvil@krampouz ~/git/bash-argsparse]# bash tutorial/1-basics -o 1
Options reporting:
option2	: yes (1)
option3	: no
option1	: no
option4	: no
help   	: no
End of argsparse report.

option1 was not on the command line.
option2 was set 1 time(s) on the command line.
option3 was not on the command line.
option4 was not on the command line.

Parameter #1: 1
GNU bash, version 5.2.37(1)-release (x86_64-redhat-linux-gnu)

My guess right now is that you're not using GNU getopt. Can you confirm?

I believe MacOS is using the BSD equivalent but will need to dig into that further,.

Anvil

Anvil commented on Apr 30, 2025

@Anvil
Owner

By default, yes, Mac has indeed a non-GNU version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Anvil@fdx-apdewis

      Issue actions

        Doesn't appear to work with MacOS "brew" port of bash · Issue #17 · Anvil/bash-argsparse