提交 61cff8e3 编写于 作者: S Sachin Goel 提交者: Robert Metzger

[FLINK-3077][cli] Add version option(-v, --version) to Cli.

This closes #1418
上级 0f98a8ed
......@@ -1000,11 +1000,20 @@ public class CliFrontend {
CliFrontendParser.printHelp();
return 0;
}
else if (action.equals("-v") || action.equals("--version")) {
String version = EnvironmentInformation.getVersion();
String commitID = EnvironmentInformation.getRevisionInformation().commitId;
System.out.print("Version: " + version);
System.out.println(!commitID.equals(EnvironmentInformation.UNKNOWN) ? ", Commit ID: " + commitID : "");
return 0;
}
else {
System.out.printf("\"%s\" is not a valid action.\n", action);
System.out.println();
System.out.println("Valid actions are \"run\", \"list\", \"info\", or \"cancel\".");
System.out.println();
System.out.println("Specify the version option (-v or --version) to print Flink version.");
System.out.println();
System.out.println("Specify the help option (-h or --help) to get help on the command.");
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册