Github user mxm commented on a diff in the pull request: https://github.com/apache/flink/pull/2149#discussion_r71354132 --- Diff: flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java --- @@ -451,4 +479,25 @@ public static InfoOptions parseInfoCommand(String[] args) throws CliArgsExceptio } } + public static MainOptions parseMainCommand(String[] args) throws CliArgsException { + + // drop all arguments after an action + final List<String> params= Arrays.asList(args); + for (String action: CliFrontend.ACTIONS) { + int index = params.indexOf(action); + if(index != -1) { + args = Arrays.copyOfRange(args, 0, index); + break; + } + } + + try { + DefaultParser parser = new DefaultParser(); + CommandLine line = parser.parse(MAIN_OPTIONS, args, false); --- End diff -- Actually you can use `CommandLine line = parser.parse(MAIN_OPTIONS, args, true);` to halt once you reach a non-arg.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---