@@ -359,13 +359,7 @@ function do_env_checks() {
359359 fi
360360}
361361
362- # ----------------------------------------------
363- # Menu bootstrap entry point
364- # ----------------------------------------------
365-
366- if [[ " $* " == * " --no-check" * ]]; then
367- echo " Skipping preflight checks."
368- else
362+ function do_checks() {
369363 do_project_checks
370364 do_env_checks
371365 do_python3_checks
@@ -384,14 +378,27 @@ else
384378 echo " rm .docker_notinstalled || rm .docker_outofdate || rm .project_outofdate"
385379 echo " "
386380 fi
387- fi
381+ }
382+
383+ function do_help() {
384+ echo " USAGE:
385+ $0 [OPTIONS...]"
386+ echo $' OPTIONS:
387+ --branch <name> override branch to check for updates
388+ (default: current branch)
389+ --no-check don\' t run any environment or git checks
390+ --run-env-setup try to make required user&group changes
391+ --encoding <enc> set encoding for menu'
392+ }
388393
389394while test $# -gt 0
390395do
391396 case " $1 " in
392397 --branch) CURRENT_BRANCH=${2:- $(git name-rev --name-only HEAD)}
393398 ;;
394- --no-check) echo " "
399+ --no-check)
400+ NO_CHECK=true
401+ echo " Skipping preflight checks."
395402 ;;
396403 --run-env-setup) # Sudo cannot be run from inside functions.
397404 echo " Setting up environment:"
411418 ;;
412419 --encoding) ENCODING_TYPE=$2
413420 ;;
414- --* ) echo " bad option $1 "
421+ --help)
422+ do_help
423+ exit 1
424+ ;;
425+ --* )
426+ echo " ERROR: unknown option: $1 "
427+ do_help
428+ exit 1
415429 ;;
416430 esac
417431 shift
418432done
419433
434+ if [[ -z " $NO_CHECK " ]]; then
435+ do_checks
436+ fi
437+
420438# This section is temporary, it's just for notifying people of potential breaking changes.
421439if [[ -f .new_install ]]; then
422440 echo " Existing installation detected."
0 commit comments