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