Skip to content

Conversation

@jasonkarns
Copy link
Contributor

@jasonkarns jasonkarns commented Dec 9, 2025

  • Add completion for bundle-binstubs subcommand and options
  • Add completions for bundle-binstubs --path, --shebang, and GEM options
  • Add binstubs subcommand to bundle-help completions

fixes #19

@jasonkarns jasonkarns changed the title bundle binstubs complete bundle-binstubs subcommand Dec 9, 2025
_filedir -d
return;;
--shebang)
options="ruby";;
Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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.
@mernen
Copy link
Owner

mernen commented Dec 22, 2025

Very well. Thanks for the contribution!

@mernen mernen merged commit 163255e into mernen:main Dec 22, 2025
0 of 2 checks passed
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.

bundle binstub doesn't complete

2 participants