Skip to content

Commit 8b278ed

Browse files
committed
Fix export cmd with predefined/default options
1 parent 5168948 commit 8b278ed

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

usr/local/share/bastille/export.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,36 +93,43 @@ if [ -n "${bastille_export_options}" ]; then
9393

9494
info "Default export option(s): '${DEFAULT_EXPORT_OPTS}'"
9595

96+
# Don't shift here when default export options are explicitly denoted in the config file, hence TARGET will always be $1.
9697
for opt in ${DEFAULT_EXPORT_OPTS}; do
9798
case "${opt}" in
99+
-a|--auto)
100+
AUTO="1"
101+
;;
98102
--gz)
99103
GZIP_EXPORT="1"
100104
opt_count
101-
shift;;
105+
;;
102106
--xz)
103107
XZ_EXPORT="1"
104108
opt_count
105-
shift;;
109+
;;
106110
--tgz)
107111
TGZ_EXPORT="1"
108112
opt_count
109113
zfs_enable_check
110-
shift;;
114+
;;
111115
--txz)
112116
TXZ_EXPORT="1"
113117
opt_count
114118
zfs_enable_check
115-
shift;;
119+
;;
116120
-s|--safe)
117121
SAFE_EXPORT="1"
118-
shift;;
122+
;;
119123
-r|--raw)
120124
RAW_EXPORT="1"
121125
opt_count
122-
shift ;;
126+
;;
123127
-v|--verbose)
124128
OPT_ZSEND="-Rv"
125-
shift;;
129+
;;
130+
-x)
131+
enable_debug
132+
;;
126133
-*) error_notify "[ERROR]: Unknown Option: \"${1}\""
127134
usage;;
128135
esac
@@ -179,7 +186,7 @@ else
179186
enable_debug
180187
shift
181188
;;
182-
-*)
189+
-*)
183190
for _opt in $(echo ${1} | sed 's/-//g' | fold -w1); do
184191
case ${_opt} in
185192
a) AUTO=1 ;;

0 commit comments

Comments
 (0)