WeiZhong94 commented on a change in pull request #11702:
URL: https://github.com/apache/flink/pull/11702#discussion_r413884884



##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/cli/ProgramOptions.java
##########
@@ -152,6 +112,26 @@ public ProgramOptions(CommandLine line) throws 
CliArgsException {
                this.savepointSettings = 
CliFrontendParser.createSavepointRestoreSettings(line);
        }
 
+       protected String[] extractProgramArgs(CommandLine line) {
+               String[] args = line.hasOption(ARGS_OPTION.getOpt()) ?
+                       line.getOptionValues(ARGS_OPTION.getOpt()) :
+                       line.getArgs();
+
+               if (args.length > 0 && !line.hasOption(JAR_OPTION.getOpt())) {
+                       jarFilePath = args[0];
+                       args = Arrays.copyOfRange(args, 1, args.length);
+               }
+
+               return args;
+       }
+
+       public void validate() throws CliArgsException {
+               // Java program should be specified a JAR file
+               if (getJarFilePath() == null) {
+                       throw new CliArgsException("Java program should be 
specified a JAR file.");

Review comment:
       Yes, either of entrypoint class and jar file is enough. But before this 
PR, we only check whether ProgramOptions.getJarFilePath() is null in 
`CliFrontend`, so I kept the original logic in the validate method. It is ok 
for me to change this validate logic in this PR. What do you think?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to