mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
setup.sh/setup: show usage when no argument is given (#2540)
This commit is contained in:
parent
1b1877f025
commit
ee0c088b1f
1
setup.sh
1
setup.sh
|
@ -236,4 +236,5 @@ function _main
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[ -z ${1:-} ]] && set 'help'
|
||||||
_main "${@}"
|
_main "${@}"
|
||||||
|
|
|
@ -167,4 +167,9 @@ function _main
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_main "${@}"
|
if [[ -z ${1:-} ]]
|
||||||
|
then
|
||||||
|
_usage
|
||||||
|
else
|
||||||
|
_main "${@}"
|
||||||
|
fi
|
||||||
|
|
|
@ -936,10 +936,10 @@ EOF
|
||||||
# --- setup.sh ----------------------------------
|
# --- setup.sh ----------------------------------
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@test "checking setup.sh: exit with error when no arguments provided" {
|
@test "checking setup.sh: show usage when no arguments provided" {
|
||||||
run ./setup.sh
|
run ./setup.sh
|
||||||
assert_failure
|
assert_success
|
||||||
assert_line --index 0 --partial "The command '' is invalid."
|
assert_output --partial "This is the main administration script that you use for all your interactions with"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "checking setup.sh: exit with error when wrong arguments provided" {
|
@test "checking setup.sh: exit with error when wrong arguments provided" {
|
||||||
|
|
Loading…
Reference in a new issue