/** * Add left-over unrecognized option/argument. * * @param arg the unrecognized option/argument. * * @return this Builder instance for method chaining. */ public Builder addArg(String arg) { commandLine.addArg(arg); return this; }
/** * Handles an unknown token. If the token starts with a dash an * UnrecognizedOptionException is thrown. Otherwise the token is added * to the arguments of the command line. If the stopAtNonOption flag * is set, this stops the parsing and the remaining tokens are added * as-is in the arguments of the command line. * * @param token the command line token to handle */ private void handleUnknownToken(String token) throws ParseException { if (token.startsWith("-") && token.length() > 1 && !stopAtNonOption) { throw new UnrecognizedOptionException("Unrecognized option: " + token, token); } cmd.addArg(token); if (stopAtNonOption) { skipParsing = true; } }
cmd.addArg(token);
/** * Add left-over unrecognized option/argument. * * @param arg the unrecognized option/argument. * * @return this Builder instance for method chaining. */ public Builder addArg(String arg) { commandLine.addArg(arg); return this; }
/** * Handles an unknown token. If the token starts with a dash an * UnrecognizedOptionException is thrown. Otherwise the token is added * to the arguments of the command line. If the stopAtNonOption flag * is set, this stops the parsing and the remaining tokens are added * as-is in the arguments of the command line. * * @param token the command line token to handle */ private void handleUnknownToken(String token) throws ParseException { if (token.startsWith("-") && token.length() > 1 && !stopAtNonOption) { throw new UnrecognizedOptionException("Unrecognized option: " + token, token); } cmd.addArg(token); if (stopAtNonOption) { skipParsing = true; } }