Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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