@Test public void testComplexLine() { final String[] parsed = CliArgParser .parse("some \"command with\" -q\"uot\\\" e\\\"d\" args\\ and\\\\ stuff"); assertArrayEquals("parsed is", new String[]{"some", "command with", "-quot\" e\"d", "args and\\", "stuff"}, parsed); }
public static String[] parse(final String input) { List<Token> tokens = lex(input); Parser parser = new Parser(); for (Token token : tokens) { parser.parseNext(token); } return parser.getArgs().toArray(new String[0]); }
CliArgParser { public static String[] parse(final String input) { List<Token> tokens = lex(input); Parser parser = new Parser(); for (Token token : tokens) { parser.parseNext(token); } return parser.getArgs().toArray(new String[0]); } }
CliArgParser { public static String[] parse(final String input) { List<Token> tokens = lex(input); Parser parser = new Parser(); for (Token token : tokens) { parser.parseNext(token); } return parser.getArgs().toArray(new String[0]); } private  CliArgParser(); }
CliArgParser { public static String[] parse(final String input) { List<Token> tokens = lex(input); Parser parser = new Parser(); for (Token token : tokens) { parser.parseNext(token); } return parser.getArgs().toArray(new String[0]); } private  CliArgParser(); static String[] parse(final String input); }
CliArgParser { public static String[] parse(final String input) { List<Token> tokens = lex(input); Parser parser = new Parser(); for (Token token : tokens) { parser.parseNext(token); } return parser.getArgs().toArray(new String[0]); } private  CliArgParser(); static String[] parse(final String input);  }