Merge pull request #794 from osalbahr/doc-install-help

doc: add `install.sh --help`. Fix #790
This commit is contained in:
Mike McQuaid
2023-07-28 15:30:42 +01:00
committed by GitHub

View File

@@ -39,6 +39,28 @@ 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] install.sh [options]
-h, --help Display this message.
NONINTERACTIVE Install without prompting for user input
CI Install in CI mode (e.g. do not prompt for user input)
EOS
exit "${1:-0}"
}
while [[ $# -gt 0 ]]
do
case "$1" in
-h | --help) usage ;;
*)
warn "Unrecognized option: '$1'"
usage 1
;;
esac
done
# string formatters
if [[ -t 1 ]]
then