Fix missing error message for invalid step doing a selection of steps

This commit is contained in:
2020-01-13 17:38:31 +01:00
parent a657473871
commit 60f6d04c3b

View File

@@ -485,7 +485,7 @@ execute() {
fi
# don't execute step functions which are not available
if [ $NOTFOUND -eq 1 ] ; then
if [ $NOTFOUND -ne 0 ] ; then
return $NOTFOUND
fi
@@ -540,7 +540,6 @@ checkStep() {
eval 'ref=$alias_'"$1"
# Catch special character after eval
if ! [[ "$ref" =~ $rex ]] ; then
echoerr " [E] Invalid step: $1"
ref=0
fi
else
@@ -548,6 +547,7 @@ checkStep() {
fi
if (( $ref < 1 || $ref > $MAX_STEP )) ; then
echoerr " [E] Invalid step: $ref"
return 0
else
existsFunction step_$ref
@@ -555,6 +555,7 @@ checkStep() {
return $ref
else
# step doesn't exist
echoerr " [E] Invalid step: $ref"
return 0
fi
fi
@@ -593,7 +594,7 @@ continous() {
execute -q $i
local res=$?
if [ $res -ne 0 ] ; then
break;
break
fi
done
}
@@ -616,7 +617,7 @@ selection() {
step=$?
# stop on step 0
if [ $step -eq 0 ] ; then
break
return 1
else
execute $step
fi