Wei Zhong created FLINK-14604:
---------------------------------
Summary: Bump commons-cli to 1.4
Key: FLINK-14604
URL:
https://issues.apache.org/jira/browse/FLINK-14604 Project: Flink
Issue Type: Improvement
Components: Command Line Client
Reporter: Wei Zhong
Currently flink is using commons-cli 1.3.1. There is a [bug|
https://issues.apache.org/jira/projects/CLI/issues/CLI-265] in it which prevent us from using options that accept variable arguments in command line.
To be precise, it prevents us from accepting a short-name option after a varargs option because there is a problem in the implementation of DefaultParser#isShortOption() method in commons-cli 1.3.1:
{code:java}
/**
* Tells if the token looks like a short option.
*
* @param token
*/
private boolean isShortOption(String token)
{
// short options (-S, -SV, -S=V, -SV1=V2, -S1S2)
// PROBLEM: It assumes that short option only has single character,
// but in fact we have many multi-characters short options.
return token.startsWith("-") && token.length() >= 2 && options.hasShortOption(token.substring(1, 2));
}
{code}
If we bump the version to 1.4, we can solve this problem.
I request this change because there are 2 varargs options which hit this bug in the design of command line options of [Python UDF Dependency Management|
https://cwiki.apache.org/confluence/display/FLINK/FLIP-78%3A+Flink+Python+UDF+Environment+and+Dependency+Management]. It will be great helpful if we can bump the commons-cli version to 1.4 :).
The commons-cli 1.4 is also a stable version which released at Mar, 2017. And today its usage statistic is greater than 1.3.1 on [maven central repository|
https://mvnrepository.com/artifact/commons-cli/commons-cli].
I have pushed the change to my own travis to check if it breaks something. This is the [link|
https://travis-ci.org/WeiZhong94/flink/builds/607438208] and it seems that everything is fine.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)