/** * Defines an option taking zero arguments (a flag). At least one among the short and long * name should be specified. * * @param shortName * the short name (one letter) associated to the option, if any * @param longName * the long name associated to the option, if any * @param description * the description associated to the option, or null to hide the option in the * help message * @return this {@code Parser} object, for call chaining */ public Parser withOption(@Nullable final String shortName, @Nullable final String longName, @Nullable final String description) { checkOptionNames(shortName, longName); final Option option = new Option(shortName == null ? null : shortName, longName, false, description); this.options.addOption(option); return this; }
final boolean mandatory) { checkOptionNames(shortName, longName); Preconditions.checkNotNull(argName); if (argName.isEmpty()) {