Skip to content

Commit 0400e6a

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 a45b4b5 commit 0400e6a

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
@@ -107,6 +107,14 @@ fi
107107

108108
mirror=''
109109
DRY_RUN=${DRY_RUN:-}
110+
111+
usage() {
112+
echo
113+
echo "USAGE: "
114+
echo " ${0} [--channel <stable|test>] [--mirror <Aliyun|AzureChinaCloud>] [--version <VERSION>] [--dry-run] [--help]"
115+
echo
116+
}
117+
110118
while [ $# -gt 0 ]; do
111119
case "$1" in
112120
--channel)
@@ -124,8 +132,13 @@ while [ $# -gt 0 ]; do
124132
VERSION="${2#v}"
125133
shift
126134
;;
135+
--help)
136+
usage
137+
exit 0
138+
;;
127139
--*)
128140
echo "Illegal option $1"
141+
usage
129142
exit 1
130143
;;
131144
esac

0 commit comments

Comments
 (0)