From b26fada58481fad513b33fc0a26a443f0445eb61 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 11 Sep 2019 16:25:47 +0200 Subject: [PATCH] exit 0 on -h Signed-off-by: Valentin Rothberg --- BuildSourceImage.sh | 3 ++- test/simple.bats | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BuildSourceImage.sh b/BuildSourceImage.sh index 4656752..f146934 100755 --- a/BuildSourceImage.sh +++ b/BuildSourceImage.sh @@ -28,7 +28,6 @@ _usage() { echo -e " -D\t\tdebuging output. Can be set via DEBUG env variable" echo -e " -h\t\tthis usage information" echo -e " -v\t\tversion" - exit 1 } # sanity checks on startup @@ -922,6 +921,7 @@ main() { ;; h) _usage + exit 0 ;; i) input_inspect_image_ref=${OPTARG} @@ -947,6 +947,7 @@ main() { ;; *) _usage + exit 1 ;; esac done diff --git a/test/simple.bats b/test/simple.bats index f2b96ff..38196b9 100644 --- a/test/simple.bats +++ b/test/simple.bats @@ -2,8 +2,7 @@ @test "Help" { run $CTR_ENGINE run --rm $CTR_IMAGE -h - [ "$status" -eq 1 ] - #TODO: we should exit 0 + [ "$status" -eq 0 ] [[ ${lines[0]} =~ "BuildSourceImage.sh version " ]] [[ ${lines[1]} =~ "Usage: BuildSourceImage.sh " ]] }