scripts: process empty string in arguments
Examples: # scripts/scylla-jmx -l /usr/lib/scylla/jmx "" Result: script stuck # scripts/scylla-jmx "" -l /usr/lib/scylla/jmx Unknown parameter: /usr/lib/scylla/jmx Result: wrongly shift arguments Above two problem caused by a redundant argument parse ("$PARAM_PORT"), the variable isn't set, so it's a covert empty string. The others valid 9 options are all parsed with right case, and API_ADDR also be set by other case path, so it's safe to remove $PARAM_PORT. This patch removed the redundant argument, and skipped empty string in arguments. Signed-off-by: Amos Kong <amos@scylladb.com> Message-Id: <74c3f75d58bab1a8348f2c87f58825eed4c5b705.1510501133.git.amos@scylladb.com>
This commit is contained in:
parent
01ba660fe7
commit
f4ef4a5a3e
@ -63,10 +63,6 @@ do
|
||||
API_ADDR="-Dapiaddress="$2
|
||||
shift 2
|
||||
;;
|
||||
"$PARAM_PORT")
|
||||
API_ADDR=$2
|
||||
shift 2
|
||||
;;
|
||||
"$PARAM_JMX_PORT")
|
||||
JMX_PORT=$2
|
||||
shift 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user