Exit pry session by alias command

Clash Royale CLAN TAG#URR8PPPExit pry session by alias command
I wanna exit pry session by q instead of exit!
q
exit!
Both are not working for me.
Pry.commands.alias_command 'q', 'exit!'
Pry.commands.rename_command 'q', 'exit!'
2 Answers
2
This works for me:
Pry.commands.alias_command :q, "!!!"
Grych's answer works great for me. Just wanted to point out that the alias_command method takes a third argument, which allows you to add a description for the alias:
alias_command
Pry.commands.alias_command :q, :exit, 'a helpful and poetic description for exiting from pry'
Pry.commands.alias_command :q, :exit, 'a helpful and poetic description for exiting from pry'
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.