From e9b4b2c0621ca6cfaf25ca02e8044cc26ce76631 Mon Sep 17 00:00:00 2001 From: B4S3D Date: Fri, 17 Dec 2021 12:06:00 -0600 Subject: [PATCH 1/2] Create usage printing function --- build/sync.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build/sync.sh b/build/sync.sh index 0ff672fe..882c9015 100755 --- a/build/sync.sh +++ b/build/sync.sh @@ -19,7 +19,14 @@ ZEALDISK= [ ! -f "$ZEALDISK" ] && echo "\$ZEALDISK is not a path to a file." && exit 1 TMPMOUNT=/tmp/zealtmp -USAGE="Usage: $0 [ repo | vm ] \n\n repo - overwrites src/ with virtual disk contents.\n vm - overwrites virtual disk with src/ contents.\n" + +print_usage() { + echo "Usage: $0 [ repo | vm ]" + echo + echo "repo - overwrites src/ with virtual disk contents." + echo "vm - overwrites virtual disk with src/ contents." + echo +} mount_vdisk() { echo "Mounting virtual disk..." @@ -38,7 +45,7 @@ umount_vdisk() { if [ -z $1 ] then - echo $USAGE + print_usage else sudo modprobe nbd [ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT @@ -71,7 +78,7 @@ else ;; *) echo "Unknown action." - echo $USAGE + print_usage ;; esac fi From 8574ab8ffbf5010afaf55ffbb8be753aac0704a9 Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Fri, 17 Dec 2021 13:13:44 -0500 Subject: [PATCH 2/2] Update sync.sh --- build/sync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/sync.sh b/build/sync.sh index 882c9015..1ed3158b 100755 --- a/build/sync.sh +++ b/build/sync.sh @@ -23,8 +23,8 @@ TMPMOUNT=/tmp/zealtmp print_usage() { echo "Usage: $0 [ repo | vm ]" echo - echo "repo - overwrites src/ with virtual disk contents." - echo "vm - overwrites virtual disk with src/ contents." + echo " repo - overwrites src/ with virtual disk contents." + echo " vm - overwrites virtual disk with src/ contents." echo }