Merge pull request #25 from vrothberg/fix-help

exit 0 on -h
This commit is contained in:
Daniel J Walsh 2019-09-11 16:27:16 -04:00 committed by GitHub
commit 22bb008514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,6 @@ _usage() {
echo -e " -D\t\tdebuging output. Can be set via DEBUG env variable" echo -e " -D\t\tdebuging output. Can be set via DEBUG env variable"
echo -e " -h\t\tthis usage information" echo -e " -h\t\tthis usage information"
echo -e " -v\t\tversion" echo -e " -v\t\tversion"
exit 1
} }
# sanity checks on startup # sanity checks on startup
@ -922,6 +921,7 @@ main() {
;; ;;
h) h)
_usage _usage
exit 0
;; ;;
i) i)
input_inspect_image_ref=${OPTARG} input_inspect_image_ref=${OPTARG}
@ -947,6 +947,7 @@ main() {
;; ;;
*) *)
_usage _usage
exit 1
;; ;;
esac esac
done done

View file

@ -2,8 +2,7 @@
@test "Help" { @test "Help" {
run $CTR_ENGINE run --rm $CTR_IMAGE -h run $CTR_ENGINE run --rm $CTR_IMAGE -h
[ "$status" -eq 1 ] [ "$status" -eq 0 ]
#TODO: we should exit 0
[[ ${lines[0]} =~ "BuildSourceImage.sh version " ]] [[ ${lines[0]} =~ "BuildSourceImage.sh version " ]]
[[ ${lines[1]} =~ "Usage: BuildSourceImage.sh " ]] [[ ${lines[1]} =~ "Usage: BuildSourceImage.sh " ]]
} }