Exit pry session by alias command

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Exit 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.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived