Polish CLI help behavior
This commit is contained in:
@@ -15,8 +15,6 @@ on_error() {
|
||||
}
|
||||
trap 'on_error "$?" "$LINENO"' ERR
|
||||
|
||||
require_root || exit $?
|
||||
|
||||
# shellcheck source=lib/storage.sh
|
||||
source "${LIB_DIR}/storage.sh"
|
||||
# shellcheck source=lib/persist.sh
|
||||
@@ -153,6 +151,14 @@ run_batch() {
|
||||
}
|
||||
|
||||
main() {
|
||||
case ${1-} in
|
||||
--help|-h)
|
||||
usage
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
require_root || return $?
|
||||
bootstrap
|
||||
|
||||
if (($# == 0)); then
|
||||
@@ -161,9 +167,6 @@ main() {
|
||||
fi
|
||||
|
||||
case ${1-} in
|
||||
--help|-h)
|
||||
usage
|
||||
;;
|
||||
--batch)
|
||||
shift
|
||||
run_batch "$@"
|
||||
|
||||
Reference in New Issue
Block a user