Skip to content

Commit

Permalink
Add BSD getopt error for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Etheryte authored and juliogonzalez committed Aug 21, 2023
1 parent c6b799a commit 5d8a76d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rel-eng/bin/mkchlog
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Uyuni project: <https://github.com/uyuni-project/uyuni>
EOF
}

# Out of the box macOS ships with BSD getopt which doesn't support long args
if [ "$(uname -s)" == "Darwin" ] && $(man getopt | grep -i -q "bsd"); then
echo "Error: This tool requires GNU getopt, but your system is using BSD getopt. Please install GNU getopt and add it to your PATH."
exit 1
fi

ARGS=$(getopt -n mkchlog -o rhnf:u: --long remove,help,no-wrap,feature:username: -- "$@")
if [ $? -ne 0 ]; then
exit 1
Expand Down

0 comments on commit 5d8a76d

Please sign in to comment.