Skip to content

Commit

Permalink
Merge pull request #794 from osalbahr/doc-install-help
Browse files Browse the repository at this point in the history
doc: add `install.sh --help`. Fix #790
  • Loading branch information
MikeMcQuaid authored Jul 28, 2023
2 parents f68ace2 + f20d07f commit 5e7f306
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e7f306

Please sign in to comment.