File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,22 @@ set -o pipefail
5
5
# fail harder
6
6
set -eu
7
7
8
+ help=false
9
+
8
10
publish=false
9
11
10
12
# process flags
11
- optstring=" :-:"
13
+ optstring=" :-:h "
12
14
while getopts " $optstring " opt; do
13
15
case $opt in
16
+ h)
17
+ help=true
18
+ ;;
14
19
-)
15
20
case " $OPTARG " in
21
+ help)
22
+ help=true
23
+ ;;
16
24
publish)
17
25
publish=true
18
26
break
27
35
# clear processed "publish" argument
28
36
shift $(( OPTIND- 1 ))
29
37
30
- if [[ $# -lt 1 ]]; then
38
+ if $help || [[ $# -lt 1 ]]; then
31
39
cat >&2 << -EOF
32
40
Usage: $( basename " $0 " ) [--publish] FORMULA-VERSION [--overwrite]
33
41
If --publish is given, mkrepo.sh will be invoked after a successful deploy to
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ set -o pipefail
10
10
# when using --progress, no output goes to stdout, but errors are mixed with progress info
11
11
S5CMD_OPTIONS=(${S5CMD_NO_SIGN_REQUEST: +--no-sign-request} ${S5CMD_PROFILE: +--profile " ${S5CMD_PROFILE} " } --log error)
12
12
13
+ help=false
14
+
13
15
checksum=
14
16
15
17
localsrc=
@@ -18,9 +20,12 @@ localdst=
18
20
remove=true
19
21
20
22
# process flags
21
- optstring=" :-:c :d:s:"
23
+ optstring=" :-:hc :d:s:"
22
24
while getopts " $optstring " opt; do
23
25
case $opt in
26
+ h)
27
+ help=true
28
+ ;;
24
29
c)
25
30
checksum=$OPTARG
26
31
;;
@@ -32,6 +37,9 @@ while getopts "$optstring" opt; do
32
37
;;
33
38
-)
34
39
case " $OPTARG " in
40
+ help)
41
+ help=true
42
+ ;;
35
43
no-remove)
36
44
remove=false
37
45
;;
45
53
# clear processed arguments
46
54
shift $(( OPTIND- 1 ))
47
55
48
- if [[ $# -lt " 2" || $# -gt " 6" ]]; then
56
+ if $help || [[ $# -lt " 2" || $# -gt " 6" ]]; then
49
57
cat >&2 << -EOF
50
58
Usage: $( basename " $0 " ) [--no-remove] [-c CHECKSUM] [-d DEST_DIR] [-s SRC_DIR] DEST_BUCKET DEST_PREFIX [DEST_REGION [SOURCE_BUCKET SOURCE_PREFIX [SOURCE_REGION]]]
51
59
DEST_BUCKET: destination S3 bucket name.
You can’t perform that action at this time.
0 commit comments