Skip to content

Commit f224972

Browse files
Merge pull request #4 from thecloudnatives/fix-hamish-complains
Correctly display help when using a single flag
2 parents ea34896 + 0c23d31 commit f224972

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

exec-cronjob/kubectl-exec_cronjob.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Run a CronJob immediately as Job by extracting the Job spec and creating a
33
# Job instance thereof.
44

5-
set -ex
5+
set -e
66

77
function usage() {
88
echo "Run a CronJob immediately as Job by extracting the Job spec and"
@@ -18,7 +18,7 @@ function usage() {
1818
exit 0
1919
}
2020

21-
if [ $# -lt 1 ]
21+
if [[ $# -lt 1 ]] || [[ "$1" == "-"* ]]
2222
then
2323
usage
2424
fi

prune-unused/kubectl-prune_unused.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function usage() {
2121
exit 0
2222
}
2323

24-
if [ "$1" == "" ]
24+
if [[ $# -lt 1 ]] || [[ "$1" == "-"* ]]
2525
then
2626
usage
2727
fi

0 commit comments

Comments
 (0)