Kousuke Saruta created SPARK-31462:
--------------------------------------
Summary: The usage of getopts and case statement is wrong in
do-release.sh
Key: SPARK-31462
URL: https://issues.apache.org/jira/browse/SPARK-31462
Project: Spark
Issue Type: Bug
Components: Project Infra
Affects Versions: 3.1.0
Reporter: Kousuke Saruta
Assignee: Kousuke Saruta
In the current master, do-release.sh contains the following code.
{code}
while getopts "bn" opt; do
case $opt in
b) GIT_BRANCH=$OPTARG ;;
n) DRY_RUN=1 ;;
?) error "Invalid option: $OPTARG" ;;
esac
done
{code}
There are 3 wrong usage in getopts and case statement.
1. To set an argument to $OPTARG for the option "b", the parameter for getopts
should be "b:".
2. To set invalid option name to $OPTARG, the parameter for getopts starts with
":".
3. It's minor but to match the character "?", it's better to escape like "\?".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]