Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command completion with quoted value fails: org.jline.reader.EOFError #257

Closed
mattirn opened this issue Apr 17, 2018 · 0 comments
Closed

Comments

@mattirn
Copy link
Collaborator

mattirn commented Apr 17, 2018

When parser is created as

        DefaultParser parser = new DefaultParser();
        parser.setEofOnUnclosedQuote(true);

then tab completion on value that starts with quote will fail to EOFError exception:

INFO: Error while parsing line
org.jline.reader.EOFError: Missing closing quote
        at org.jline.reader.impl.DefaultParser.parse(DefaultParser.java:166)
        at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:3865)
        at org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:3788)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:548)
        at com.smo.sdn.controller.rest.executor.CommandLine.interact(CommandLine.java:242)
        at com.smo.sdn.controller.rest.executor.RestExecutor.main(RestExecutor.java:73)

This can be fixed by rewriting the if statement, DefaultParser.java:165 as

        if (eofOnUnclosedQuote && quoteStart >= 0 && context!=ParseContext.COMPLETE) {

Thank you for the great work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant