-
Notifications
You must be signed in to change notification settings - Fork 21
complete bundle-binstubs subcommand #20
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
Conversation
completion-bundle
Outdated
| _filedir -d | ||
| return;; | ||
| --shebang) | ||
| options="ruby";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 50/50 on whether completing the default value for SHEBANG makes any sense. On one hand, it's instructive. But OTOH, if you intend to use the "ruby" shebang, then there's no reason to pass the option+arg in the first place.
So maybe I should just remove these two lines? Either way, I suppose we'd want the behavior the match with install --shebang completion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could suggest all commands that have "ruby" in the name?
# Suggest all commands that contain "ruby"; skip those that start with underscore as they are usually functions and/or private
options=$(compgen -X '!*ruby*' -c -- "$cur" | grep -v '^_')(I had to include the grep filter because I couldn't make compgen only return commands in $PATH, not functions, and our own __ruby function would pollute the results)
This would allow one to see e.g. jruby and ruby3.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps. If that's desirable, that can be its own work? For now, I just removed the --shebang opt-args completion, so binstubs is consistent with install. The main goal of this PR is to support binstub flags like --all and bundled gems.
`install` doesn't complete the shebang option-args, so let's not do so for binstubs at the moment. If that's desired in the future, it can be its own feature and be consistent for both subcommands.
|
Very well. Thanks for the contribution! |
fixes #19