-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add trailing slash when looking for directories #24
Conversation
If the given input is a path with a trailing slash, the directories in it will now be completed with a trailing slash.
I've checked that by default bash behaves as you decribed here and in the issue. Thank you for reporting this. This PR requires some extra work before it's ready to be merged. Please check failing CI runs on Linux (ignore macOS and FreeBSD for now because they require custom setup) From a brief look at failed test cases here are the things that need to be fixed:
- {'usr/share/', 'usr/somefile'}
+ {'somefile', 'share/'} Looking from a higher level though... I'm not sure I like the first part of the diff. "FIXME" is kinda a red flag right away, but even without that a duplicated if [[ "_$ACTION" == "_directory" ]]
then
OPTION="dirnames"
else
OPTION="filenames"
fi How about leaving this section largely intact and setting all compgen keys there? ( |
👍
I have noticed that too, but I failed to figure out when this case appears. Even while manually testing the
Omg, sorry, I forgot to fix that before opening a PR
This does sound better than the current solution. However, it doesn't seem to work on my machine:
|
That's weird. Doesn't work for me too. Anyways, the idea was to provide all arguments in one variable and then call |
Oops, that's accidental. I don't think I'll ever get back to this, though. Anyone is welcome to use the code as the base for a better implementation, if needed. |
Fixes #22 (although, I'm not sure this is the only place that should be updated)