Merge pull request #794 from osalbahr/doc-install-help
doc: add `install.sh --help`. Fix #790
This commit is contained in:
22
install.sh
22
install.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user