@Test void testOneBoolOpt() { ParsedOutput output = testParser.parse(new ArrayList<>(List.of("up", "--update"))); Assertions.assertEquals(output.getOptions().size(), 1); Assertions.assertEquals(output.getArguments().size(), 0); Assertions.assertEquals(output.getOptions().get(flagTwo), true); }
public ParsedOutput parse(List<String> args) { final Command commandName = this.findCommand(args); fillShortAndLongOptions(commandName); final Map<CommandFlag, Object> options = this.findOptions(args); return new ParsedOutput(commandName, args, options); }
Parser { public ParsedOutput parse(List<String> args) { final Command commandName = this.findCommand(args); fillShortAndLongOptions(commandName); final Map<CommandFlag, Object> options = this.findOptions(args); return new ParsedOutput(commandName, args, options); } }
Parser { public ParsedOutput parse(List<String> args) { final Command commandName = this.findCommand(args); fillShortAndLongOptions(commandName); final Map<CommandFlag, Object> options = this.findOptions(args); return new ParsedOutput(commandName, args, options); } Parser(final Map<Command, ? extends Collection<CommandFlag>> commandToFlags); }
Parser { public ParsedOutput parse(List<String> args) { final Command commandName = this.findCommand(args); fillShortAndLongOptions(commandName); final Map<CommandFlag, Object> options = this.findOptions(args); return new ParsedOutput(commandName, args, options); } Parser(final Map<Command, ? extends Collection<CommandFlag>> commandToFlags); ParsedOutput parse(List<String> args); }
Parser { public ParsedOutput parse(List<String> args) { final Command commandName = this.findCommand(args); fillShortAndLongOptions(commandName); final Map<CommandFlag, Object> options = this.findOptions(args); return new ParsedOutput(commandName, args, options); } Parser(final Map<Command, ? extends Collection<CommandFlag>> commandToFlags); ParsedOutput parse(List<String> args);  }