Discard empty args
- Take 2 of #763
- Revert changes in 06e89dcca3
what comes for `ExtendedDefaultParser`.
- Discard empty args in a `Shell` coming from `ExtendedDefaultParser`
- `ExtendedDefaultParserTests` has more tests, some commented out, to
see some differences for jline default parser impl. Something
to get handled in #517
This commit is contained in:
@@ -195,7 +195,9 @@ public class Shell {
|
||||
return NO_INPUT;
|
||||
}
|
||||
|
||||
List<String> words = input.words();
|
||||
// List<String> words = input.words();
|
||||
// gh-763
|
||||
List<String> words = input.words().stream().filter(w -> w.length() > 0).collect(Collectors.toList());
|
||||
String line = words.stream().collect(Collectors.joining(" ")).trim();
|
||||
String command = findLongestCommand(line, false);
|
||||
|
||||
|
||||
@@ -126,12 +126,10 @@ public class ExtendedDefaultParser implements Parser {
|
||||
}
|
||||
|
||||
if (current.length() > 0 || (line != null && cursor == line.length())) {
|
||||
if (current.length() > 0) {
|
||||
words.add(current.toString());
|
||||
}
|
||||
words.add(current.toString());
|
||||
}
|
||||
|
||||
if (line != null && cursor == line.length() && words.size() > 0) {
|
||||
if (line != null && cursor == line.length()) {
|
||||
wordIndex = words.size() - 1;
|
||||
wordCursor = words.get(words.size() - 1).length();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user