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

Improve filename completion #204

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Improve filename completion #204

wants to merge 6 commits into from

Conversation

tkruse
Copy link
Contributor

@tkruse tkruse commented Aug 13, 2015

This supercedes #203.
This fixes #90, and adds a lot of tests and some features to FileNameCompleter and ArgumentCompleter.

ArgumentCompleter will now attempt escape candidates based on the ArgumentDelimiter. This should help e.g. with Filenames having blanks. If the argument is within the context of an opening quote, no escaping will happen, but the argumentHandler will provide a closing quote if the subcompleter suggests a candidate ending with a delimiter (blank).

FileNameCompleter can now configured to not provide a blank, it can be configured to complete folders themselves and also to not complete files (just folders if that is enabled), and users can add a filter in subclasses to exclude files based on custom logic.

I did not test the changes on other operating systems than Linux.

The small commits fixing minor stuff could be merged early, if you like.

- duplicate code into shared method
- removed useless isQuote() Method. Logic for quote is in main loop.
…open quotes

This breaks the API by extending the interface ArgumentCompleter.ArgumentDelimiter
Not sure whether this is still acceptable for jline2 2.x
- provide option to complete folders themselves
- provide option to not complete files
- allow suppressing final blank (fix #90)
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

Successfully merging this pull request may close these issues.

FilenameCompletor finalizing blank suffix should be optional
1 participant