@Test void testListOptWithShortAndLongNames() { ParsedOutput output = testParser.parse( new ArrayList<>(List.of("init", "-c", "foo", "--create", "bar", "-c", "baz"))); Assertions.assertEquals(output.getOptions().size(), 1); Assertions.assertEquals(output.getArguments().size(), 0); Assertions.assertEquals(output.getOptions().get(flagOne), List.of("foo", "bar", "baz")); }
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);  }