fix(mkrootfs&mkimg): fix argument parser (#6)

This commit is contained in:
Avimitin Lu 2022-09-13 12:05:55 +08:00 committed by GitHub
parent ec4bad56d6
commit 218dcea615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

3
mkimg
View file

@ -10,6 +10,7 @@ colorize
verbose=0 verbose=0
use_fixed_password=0 use_fixed_password=0
varbose_arg= varbose_arg=
rootfs="archriscv-$(date --rfc-3339=date).tar.zst"
show_help() { show_help() {
cat << EOF cat << EOF
@ -43,7 +44,7 @@ parse-args() {
;; ;;
p) password=$OPTARG p) password=$OPTARG
;; ;;
r) rootfs=${OPTARG:-archriscv-$(date --rfc-3339=date).tar.zst} r) rootfs=$OPTARG
;; ;;
*) *)
show_help >&2 show_help >&2

View file

@ -9,6 +9,7 @@ colorize
verbose=0 verbose=0
varbose_arg= varbose_arg=
password='archriscv'
show_help() { show_help() {
cat << EOF cat << EOF
@ -36,7 +37,7 @@ parse-args() {
v) verbose=$((verbose+1)) v) verbose=$((verbose+1))
varbose_arg="--verbose" varbose_arg="--verbose"
;; ;;
p) password=${OPTARG:-archriscv} p) password=$OPTARG
;; ;;
*) *)
show_help >&2 show_help >&2