Skip to content

Commit 5e9b275

Browse files
committed
Add --help flag to install.sh and usage function
Signed-off-by: H Dub <14808878+hdub-tech@users.noreply.github.com>
1 parent bb89489 commit 5e9b275

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ mirror=''
131131
DRY_RUN=${DRY_RUN:-}
132132
REPO_ONLY=${REPO_ONLY:-0}
133133
NO_AUTOSTART=${NO_AUTOSTART:-0}
134+
135+
usage() {
136+
echo
137+
echo "USAGE: "
138+
echo " ${0} [--channel <stable|test>] [--mirror <Aliyun|AzureChinaCloud>] [--version <VERSION>] [--dry-run] [--help]"
139+
echo
140+
}
141+
134142
while [ $# -gt 0 ]; do
135143
case "$1" in
136144
--channel)
@@ -155,8 +163,13 @@ while [ $# -gt 0 ]; do
155163
--no-autostart)
156164
NO_AUTOSTART=1
157165
;;
166+
--help)
167+
usage
168+
exit 0
169+
;;
158170
--*)
159171
echo "Illegal option $1"
172+
usage
160173
exit 1
161174
;;
162175
esac

0 commit comments

Comments
 (0)