Skip to content

Commit

Permalink
[FLINK-3077][cli] Add version option(-v, --version) to Cli.
Browse files Browse the repository at this point in the history
This closes apache#1418
  • Loading branch information
sachingoel0101 authored and rmetzger committed Dec 12, 2015
1 parent 0f98a8e commit 61cff8e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1000,11 +1000,20 @@ else if (action.equals("-h") || action.equals("--help")) {
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;
}
Expand Down

0 comments on commit 61cff8e

Please sign in to comment.