diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-17 12:24:34 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-17 12:24:34 +0200 |
commit | e28c1e2d9e4620e343abc95f19533d285dc574a9 (patch) | |
tree | 00666fa0087705bc84d27c6bb390a7c2bb28de63 /bootstrap-cmake.sh | |
parent | c85d8be22ce8095271b0925b1acf78210e089f78 (diff) |
Fix bug where usage would never be printed
Diffstat (limited to 'bootstrap-cmake.sh')
-rw-r--r-- | bootstrap-cmake.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bootstrap-cmake.sh b/bootstrap-cmake.sh index 8fe99e47df7..c707d10a25a 100644 --- a/bootstrap-cmake.sh +++ b/bootstrap-cmake.sh @@ -5,15 +5,15 @@ usage() { echo "Usage: $0 <source-dir> [<extra-cmake-args>]" >&2 } -if [[ $# -eq 1 ]]; then +if [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then + usage + exit 0 +elif [[ $# -eq 1 ]]; then SOURCE_DIR=$1 EXTRA_CMAKE_ARGS="" elif [ $# -eq 2 ]; then SOURCE_DIR=$1 EXTRA_CMAKE_ARGS=$2 -elif [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then - usage - exit 0 else echo "Wrong number of arguments: expected 1 or 2, was $#" >&2 usage |