Fix using $1 to check if no step was given, although it was shifted

Dry run no longer also assumes -q (quiet) option
This commit is contained in:
2019-10-09 23:42:36 +02:00
parent 519bc7aa92
commit 69740bf6ee

View File

@@ -428,13 +428,13 @@ exep() {
main() {
local START=0
local EMPTYCALL=1
# options check
for arg in "$@" ; do
case "$1" in
--dry-run|-d) # shows what would be done
DRY=1
QUIET=1
shift
;;
--help|-h) # show only help
@@ -462,6 +462,7 @@ main() {
# Assume starting at one for interactive mode
START=1
else
EMPTYCALL=0
read -r -a START <<< "$1"
shift
STEP_ARGS="$@"
@@ -484,7 +485,7 @@ main() {
fi
# check for starting step
if [ -z "$1" ] ; then
if [ $EMPTYCALL -ne 0 ] ; then
# End here on quiet mode and no step was given
if [ $QUIET -eq 1 ] ; then
exit 1;