doc: add install.sh --help. Fix #790

Adapted from `uninstall.sh`
This commit is contained in:
Osama Albahrani
2023-07-27 18:15:51 -04:00
parent f68ace21f6
commit 92f67fa0a8

View File

@@ -39,6 +39,29 @@ then
abort 'Bash must not run in POSIX mode. Please unset POSIXLY_CORRECT and try again.'
fi
usage() {
cat <<EOS
Homebrew Installer
Usage: [NONINTERACTIVE=1] [CI=1] $0 [options]
-h, --help Display this message.
NONINTERACTIVE Install without prompting.
CI Imply NONINTERACTIVE.
EOS
exit "${1:-0}"
}
while [[ $# -gt 0 ]]
do
case "$1" in
-h | --help) usage ;;
*)
warn "Unrecognized option: '$1'"
usage 1
;;
esac
# shift # Command appears to be unreachable. Check usage (or ignore if invoked indirectly). shellcheck (SC2317)
done
# string formatters
if [[ -t 1 ]]
then