Skip to content

Commit b139d5a

Browse files
committed
enables curly and square bracket parsing, fixes #350
1 parent 2517f78 commit b139d5a

File tree

4 files changed

+502
-496
lines changed

4 files changed

+502
-496
lines changed

aesh/src/main/java/org/aesh/command/impl/parser/AeshCommandLineParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ public ProcessedOption lastParsedOption() {
570570
*/
571571
@Override
572572
public void parse(String line, Mode mode) {
573-
parse(lineParser.parseLine(line, line.length()).iterator(), mode);
573+
parse(lineParser.parseLine(line, line.length(), true).iterator(), mode);
574574
}
575575

576576
@Override

aesh/src/test/java/org/aesh/command/parser/CommandLineParserTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ public void testParseCommandLine1() throws Exception {
119119
assertEquals("g", p1.define.get("f"));
120120
assertEquals("/tmp/file.txt", p1.arguments.get(0));
121121

122+
parser.populateObject("test -e true {\"distributed-cache\":{}}", invocationProviders, aeshContext, CommandLineParser.Mode.VALIDATE);
123+
assertEquals("{\"distributed-cache\":{}}", p1.arguments.get(0));
124+
122125
parser = new AeshCommandContainerBuilder<>().create(new Parser1aTest<>()).getParser();
123126

124127
parser.populateObject("test -f -e bar /tmp/file.txt", invocationProviders, aeshContext, CommandLineParser.Mode.VALIDATE);

0 commit comments

Comments
 (0)