Skip to content

Commit d35471a

Browse files
committed
cmd-buildextend-metal: set variables at top of main
And also refactor to drop the rc variable.
1 parent 5509a8b commit d35471a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/cmd-buildextend-metal

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ EOF
188188

189189

190190
main() {
191+
# Set Some Defaults
192+
genprotimgvm=/data.secex/genprotimgvm.qcow2
193+
build=
194+
force=
191195

192196
# This script is used for creating several artifacts. For example,
193197
# `cmd-buildextend-qemu` is a symlink to `cmd-buildextend-metal`.
@@ -200,13 +204,7 @@ main() {
200204
*) fatal "called as unexpected name $0";;
201205
esac
202206

203-
# Parse options
204-
genprotimgvm=/data.secex/genprotimgvm.qcow2
205-
rc=0
206-
build=
207-
force=
208-
options=$(getopt --options h --longoptions help,force,build:,genprotimgvm: -- "$@") || rc=$?
209-
[ $rc -eq 0 ] || {
207+
options=$(getopt --options h --longoptions help,force,build:,genprotimgvm: -- "$@") || {
210208
print_help
211209
exit 1
212210
}

0 commit comments

Comments
 (0)