/** * Checks whether or not the user has passed a "help" option and is asking for help. * * @return {@code true} if the user command line has enabled a "Help" option, {@link false} otherwise. */ @Override public boolean isAskingForHelp() { for (Option option : cli.getOptions()) { if (option.isHelp() && isSeenInCommandLine(option)) { return true; } } return false; } }
private <T> T getValue(TypedOption<T> option) { if (isOptionAssigned(option)) { return create(getRawValueForOption(option), option); } else { if (option.getDefaultValue() != null) { return create(getRawValueForOption(option), option); } if (option.isFlag() || isBoolean(option)) { try { if (isSeenInCommandLine(option)) { return (T) Boolean.TRUE; } else { return (T) Boolean.FALSE; } } catch (InvalidValueException e) { throw new IllegalArgumentException(e); } } } return null; }
/** * Checks whether or not the user has passed a "help" option and is asking for help. * * @return {@code true} if the user command line has enabled a "Help" option, {@link false} otherwise. */ @Override public boolean isAskingForHelp() { for (Option option : cli.getOptions()) { if (option.isHelp() && isSeenInCommandLine(option)) { return true; } } return false; } }
private <T> T getValue(TypedOption<T> option) { if (isOptionAssigned(option)) { return create(getRawValueForOption(option), option); } else { if (option.getDefaultValue() != null) { return create(getRawValueForOption(option), option); } if (option.isFlag() || isBoolean(option)) { try { if (isSeenInCommandLine(option)) { return (T) Boolean.TRUE; } else { return (T) Boolean.FALSE; } } catch (InvalidValueException e) { throw new IllegalArgumentException(e); } } } return null; }