GitHub user yaooqinn opened a pull request:
https://github.com/apache/spark/pull/20571
[SPARK-23383][Build][Minor]Make a distribution should exit with usage while
detecting wrong options
## What changes were proposed in this pull request?
```shell
./dev/make-distribution.sh --name ne-1.0.0-SNAPSHOT xyz --tgz -Phadoop-2.7
+++ dirname ./dev/make-distribution.sh
++ cd ./dev/..
++ pwd
+ SPARK_HOME=/Users/Kent/Documents/spark
+ DISTDIR=/Users/Kent/Documents/spark/dist
+ MAKE_TGZ=false
+ MAKE_PIP=false
+ MAKE_R=false
+ NAME=none
+ MVN=/Users/Kent/Documents/spark/build/mvn
+ (( 5 ))
+ case $1 in
+ NAME=ne-1.0.0-SNAPSHOT
+ shift
+ shift
+ (( 3 ))
+ case $1 in
+ break
+ '[' -z /Users/Kent/.jenv/candidates/java/current ']'
+ '[' -z /Users/Kent/.jenv/candidates/java/current ']'
++ command -v git
+ '[' /usr/local/bin/git ']'
++ git rev-parse --short HEAD
+ GITREV=98ea6a7
+ '[' '!' -z 98ea6a7 ']'
+ GITREVSTRING=' (git revision 98ea6a7)'
+ unset GITREV
++ command -v /Users/Kent/Documents/spark/build/mvn
+ '[' '!' /Users/Kent/Documents/spark/build/mvn ']'
++ /Users/Kent/Documents/spark/build/mvn help:evaluate
-Dexpression=project.version xyz --tgz -Phadoop-2.7
++ grep -v INFO
++ tail -n 1
+ VERSION=' -X,--debug Produce execution debug
output'
```
It is better to declare the mistakes and exit with usage than `break`
## How was this patch tested?
manually
cc @srowen
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/yaooqinn/spark SPARK-23383
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20571.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20571
----
commit 81c1b2407ceb478d6795438de82ac6afe65024c8
Author: Kent Yao <yaooqinn@...>
Date: 2018-02-11T03:48:30Z
exit with usage
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]