-
Notifications
You must be signed in to change notification settings - Fork 121
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 helper aliases #957
Comments
I currently don't plan to support helper aliases because unlike commands, their aliases need to be valid Ruby code. This means that we need to also validate the alias users use, which is complexity I don't want to add without seeing clear benefit. Looking at your gem's "helpers", I think almost all of them should actually be commands? If their use cases are displaying information or performing tasks (copy & pasting), not directly interacting with other parts of the "app", then they should be commands, not helpers. FWIW, I think certain helpers actually overlap with IRB's builtin commands:
|
Thanks, that's good to know and, yes, no need to add complexity if there isn't a need for aliasing helpers.
Thanks. So this would be an opportunity to clarify in the documentation. I found this confusing so opted to use helpers instead of commands because they seemed simpler and more lightweight to implement. I've taken note of this and will fold your suggestions into a future version release.
This is partially correct, I agree, but they serve a different purpose with the following benefit:
Yeah, this is similar to what I was saying about
Based on this discussion, I'm going close this since there is no further action. The rest I can follow up with on my end. Thanks for the feedback! |
Do you think expanding the first paragraph with example use cases for each type will help? For example:
Hmm, I think maybe it's worth adding a flag to |
Yes! I also like the last line to drive home the point.
Hmm, I might drop the duplication on my side, because I was able to confirm iTerm still honors the the file path and line number by opening appropriately in my IDE. Thanks.
Yeah, that would be handy. Either like how I do it (using search IRB, "start"
# [
# start(*ap_path) IRB.start (ap_path=..
# ] ..or via IRB.method(:start).parameters
# [
# [
# :opt,
# :ap_path
# ]
# ] I have Amazing Print wired into my IRB config so gives me a structured dump but using collapsed/single line output makes sense too. |
Thanks for the feedback. I added #965 for it 🙂 |
Awesome, thanks! 🙇 |
Description
Hello. 👋 With the new extension support in IRB 1.13.0, would it be possible to add
IRB.conf[:HELPER_ALIASES]
like we have for command aliases? I ask, because theHELPER_ALIASES
key doesn't exist and if you try to add an alias for a helper within the existing command aliases, you'll get an stack dump. Example:💡 IRB Kit is a new gem I'm using to load custom helpers within IRB.
Alternatively, if the above is not desired, it might not make sense to have a key for command and helper aliases since I'm not sure how you'd differentiate between the two (at least not easily). So maybe you should be able to alias both commands and helpers via a single key (i.e. simply:
ALIASES
)?Result of irb_info
Terminal Emulator
iTerm2
Setting Files
~/.config/irb/irbrc
(via XDG)The text was updated successfully, but these errors were encountered: