Removed mandatory args check from entrypoint.sh
- Now none is mandatory
This commit is contained in:
parent
e2b63c6107
commit
a64a667842
|
|
@ -3,9 +3,6 @@
|
|||
# Script configurations
|
||||
SCRIPT="KiBot"
|
||||
|
||||
# Mandatory arguments
|
||||
margs=1
|
||||
|
||||
# Arguments and their default values
|
||||
CONFIG=""
|
||||
BOARD=""
|
||||
|
|
@ -84,28 +81,6 @@ function usage {
|
|||
}
|
||||
|
||||
|
||||
# Ensures that the number of passed args are at least equals
|
||||
# to the declared number of mandatory args.
|
||||
# It also handles the special case of the -h or --help arg.
|
||||
function margs_precheck {
|
||||
if [ "$1" -lt "$margs" ]; then
|
||||
if [ "$2" == "--help" ] || [ "$2" == "-h" ]; then
|
||||
help
|
||||
else
|
||||
usage
|
||||
fi
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
}
|
||||
|
||||
# Ensures that all the mandatory args are not empty
|
||||
function margs_check {
|
||||
if [ "$#" -lt "$margs" ]; then
|
||||
usage
|
||||
exit $EXIT_ERROR
|
||||
fi
|
||||
}
|
||||
|
||||
function args_process {
|
||||
while [ "$1" != "" ];
|
||||
do
|
||||
|
|
@ -193,8 +168,6 @@ function run {
|
|||
}
|
||||
|
||||
function main {
|
||||
margs_precheck "$#" "$1"
|
||||
|
||||
args_process "$@"
|
||||
|
||||
run
|
||||
|
|
|
|||
Loading…
Reference in New Issue