Skip to content

Commit

Permalink
Closes linkedin#70. Fix help parsing in Client to avoid triggering wh…
Browse files Browse the repository at this point in the history
…en -hadoop_binary is the first option.
  • Loading branch information
xkrogen committed Mar 1, 2019
1 parent 9485c19 commit 4807832
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ private void printUsage() {
*/
public boolean init(String[] args) throws ParseException, IOException {

CommandLineParser parser = new GnuParser();
if (parser.parse(new Options().addOption("h", "help", false, "Shows this message."), args, true).hasOption("h")) {
if (Arrays.stream(args).anyMatch(arg -> arg.equalsIgnoreCase("-h") || arg.equals("--help"))) {
printUsage();
return false;
}

CommandLineParser parser = new GnuParser();
CommandLine cliParser = parser.parse(opts, args);

yarnClient = YarnClient.createYarnClient();
Expand Down

0 comments on commit 4807832

Please sign in to comment.