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 and unquoted values #245

Closed
csetera opened this issue Mar 29, 2018 · 2 comments
Closed

Command completion with quoted and unquoted values #245

csetera opened this issue Mar 29, 2018 · 2 comments
Milestone

Comments

@csetera
Copy link

csetera commented Mar 29, 2018

As discussed in the users forum, I have a use case where I want to provide completion of a value that may or may not have a space. What I was trying to do was alter the value of a Candidate to automatically add the quotes only if they were necessary. However, that means that JLine will automatically filter those candidates if the user didn't start the completion with a quote. I can't seem to figure out a way to solve for completing these values that does not require the user to start the prompt with a quote.

After further thought since I sent that to the group, it seems to me that the way I would want to approach this (if I were to attempt to create the changes) would be to have another boolean value "quoted" on the Candidate class. If that value is true when the value is inserted by Jline, it automatically quotes the value being inserted. That allows the candidate to match properly, but also to provide the proper result. It also means that there is no guesswork in if/when to quote because the Candidate is making that choice.

@csetera
Copy link
Author

csetera commented Mar 29, 2018

For what it's worth, using escaping does work for this use case. I still think auto-quoting would be a really nice feature, but with escaping working my need is lower priority.

@gnodet
Copy link
Member

gnodet commented Apr 5, 2018

This is related to #125

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

2 participants