From ebae43e450922de821f64e1a29d990ec051ec5b6 Mon Sep 17 00:00:00 2001 From: tcely Date: Wed, 8 Apr 2026 01:06:11 -0400 Subject: [PATCH] feat(llvm.sh): long options support --- llvm.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llvm.sh b/llvm.sh index 76efa80..5be9c87 100755 --- a/llvm.sh +++ b/llvm.sh @@ -30,7 +30,7 @@ usage() { echo -e "-n=code_name\t\tSpecifies the distro codename, for example bionic" 1>&2 echo -e "-h\t\t\tPrints this help." 1>&2 echo -e "-m=repo_base_url\tSpecifies the base URL from which to download." 1>&2 - exit 1; + exit $# } CURRENT_LLVM_STABLE=20 @@ -131,6 +131,15 @@ case ${DISTRO} in ;; esac +# check for long options +for arg in "$@"; do + case "${arg}" in + (--help|-h) usage ;; + (--version) usage error ;; + (--) break ;; + esac +done + # read optional command line arguments if [ "$#" -ge 1 ] && [ "${1::1}" != "-" ]; then if [ "$1" != "all" ]; then