Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.1.0
-
None
Description
In the current master, do-release.sh contains the following code.
while getopts "bn" opt; do case $opt in b) GIT_BRANCH=$OPTARG ;; n) DRY_RUN=1 ;; ?) error "Invalid option: $OPTARG" ;; esac done
There are 3 wrong usage in getopts and case statement.
1. To set $OPTARG to an argument passed for the option "b", the parameter for getopts should be "b:".
2. To set $OPTARG to the invalid option name passed, the parameter for getopts starts with ":".
3. It's minor but to match the character "?", it's better to escape like "?".
Attachments
Issue Links
- links to