diff options
author | François Garillot <francois@garillot.net> | 2015-07-24 17:09:33 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-07-24 17:09:33 +0100 |
commit | 428cde5d1c46adad344255447283dfb9716d65cb (patch) | |
tree | bc2ed274d5d6d91a690119702605fc467b6d821a /dev/change-scala-version.sh | |
parent | 846cf46282da8f4b87aeee64e407a38cdc80e13b (diff) | |
download | spark-428cde5d1c46adad344255447283dfb9716d65cb.tar.gz spark-428cde5d1c46adad344255447283dfb9716d65cb.tar.bz2 spark-428cde5d1c46adad344255447283dfb9716d65cb.zip |
[SPARK-9250] Make change-scala-version more helpful w.r.t. valid Scala versions
Author: François Garillot <francois@garillot.net>
Closes #7595 from huitseeker/issue/SPARK-9250 and squashes the following commits:
80a0218 [François Garillot] [SPARK-9250] Make change-scala-version's usage more explicit, introduce a -h|--help option.
Diffstat (limited to 'dev/change-scala-version.sh')
-rwxr-xr-x | dev/change-scala-version.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/dev/change-scala-version.sh b/dev/change-scala-version.sh index b81c00c9d6..d7975dfb64 100755 --- a/dev/change-scala-version.sh +++ b/dev/change-scala-version.sh @@ -19,19 +19,23 @@ set -e +VALID_VERSIONS=( 2.10 2.11 ) + usage() { - echo "Usage: $(basename $0) <version>" 1>&2 + echo "Usage: $(basename $0) [-h|--help] <version> +where : + -h| --help Display this help text + valid version values : ${VALID_VERSIONS[*]} +" 1>&2 exit 1 } -if [ $# -ne 1 ]; then +if [[ ($# -ne 1) || ( $1 == "--help") || $1 == "-h" ]]; then usage fi TO_VERSION=$1 -VALID_VERSIONS=( 2.10 2.11 ) - check_scala_version() { for i in ${VALID_VERSIONS[*]}; do [ $i = "$1" ] && return 0; done echo "Invalid Scala version: $1. Valid versions: ${VALID_VERSIONS[*]}" 1>&2 |