Only log after parsing all arguments

This commit is contained in:
Salt 2019-06-22 02:16:47 -05:00
parent 8681346661
commit 5503648f6c

View File

@ -535,10 +535,7 @@ main() {
while getopts ":dgh" opt; do while getopts ":dgh" opt; do
case $opt in case $opt in
d) d)
if [ -z "$_dryrun" ]; then _dryrun=1
log "Performing a dry run"
_dryrun=1
fi
;; ;;
g) g)
step_generate step_generate
@ -556,6 +553,7 @@ main() {
;; ;;
esac esac
done done
[ -n "$_dryrun" ] && log "Performing a dry run"
step_check step_check
step_preexecute step_preexecute
step_execute step_execute