Skip to content

Commit c577df2

Browse files
committed
refresh_rhcos: Add help text
Signed-off-by: Stephen Finucane <[email protected]>
1 parent fc8fa2a commit c577df2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

refresh_rhcos.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
set -eu
44
set -o pipefail
55

6+
function show_usage() {
7+
echo "Refresh RHCOS image on cloud"
8+
echo ""
9+
echo " $0 [-h] [-b <BRANCH>]"
10+
echo ""
11+
echo "Options:"
12+
echo " -b <BRANCH> The branch name. Example: 4.18"
13+
echo " -h Show this help text."
14+
exit 0
15+
}
16+
617
if [ -z "$OS_CLOUD" ]; then
718
echo 'Set your OS_CLOUD environment variable'
819
exit 1
920
fi
1021

1122
BRANCH="4.2"
1223

13-
opts=$(getopt -n "$0" -o "b:" --long 'branch:' -- "$@")
24+
opts=$(getopt -n "$0" -o "b:h" --long 'branch:,help' -- "$@")
1425

1526
eval set "--$opts"
1627

@@ -19,11 +30,13 @@ mkdir -p "$CACHE_DIR"
1930

2031
while [[ $# -gt 0 ]]; do
2132
case "$1" in
33+
-h|--help)
34+
show_usage
35+
;;
2236
-b|--branch)
2337
BRANCH=$2
2438
shift 2
2539
;;
26-
2740
*)
2841
break
2942
;;

0 commit comments

Comments
 (0)