- Notifications
You must be signed in to change notification settings - Fork66
fix(stm32CubeProg): fallback to BSD getopt on mac#100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
439a07d
to4020213
Compare8fee15e
to1c5f1bd
Compareif ! command -v $STM32CP_CLI >/dev/null 2>&1; then | ||
aborting | ||
fi | ||
if ! command -v /usr/local/opt/gnu-getopt/bin/getopt >/dev/null 2>&1; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
By the way, for Apple Silicon devices, the path should be/opt/homebrew/opt/gnu-getopt/
, maybe this needs to be checked as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi@lhvy
Thanks for the feedback, I'm not familiar with mac.
So something like this:
if!command -v /usr/local/opt/gnu-getopt/bin/getopt>/dev/null2>&1;thenif!command -v /opt/homebrew/opt/gnu-getopt/bin/getopt>/dev/null2>&1;thenecho"Warning: long options not supported due to getopt from FreeBSD usage." GNU_GETOPT=nelseexport PATH="/opt/homebrew/opt/gnu-getopt/bin":"$PATH"fielseexport PATH="/usr/local/opt/gnu-getopt/bin":"$PATH"fi
By default, MacOS uses getopt from FreeBSD and not the GNU-based one.Then "-o" and long options are not supported except if gnu-getoptis installed.Fixesstm32duino#99Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Uh oh!
There was an error while loading.Please reload this page.
By default, MacOS uses getopt from FreeBSD and not the GNU-based one.
Then "-o" and long options are not supported except if gnu-getopt is installed.
Fixes#99
Main advantage to kept GNU getopt by default is it is able to deal with space in arguments.
Install the package
gnu-getopt
via e.g.Homebrew:If not installed the BSD getopt is used but long option and space in arguments are not supported.