From 7c5d55d35401cce1d9f47251baf88585ab970cba Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sun, 1 Apr 2012 16:09:40 -0700 Subject: [PATCH] Add an add_command method to command sets This is to accomodate people who want to make their own Command subclasses --- lib/pry/command_set.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pry/command_set.rb b/lib/pry/command_set.rb index 986acda9..658d5889 100644 --- a/lib/pry/command_set.rb +++ b/lib/pry/command_set.rb @@ -152,6 +152,12 @@ class Pry @commands.each(&block) end + # Add a given command object to this set. + # @param Command the subclass of Pry::Command you wish to add. + def add_command(command) + commands[command.match] = command + end + # Removes some commands from the set # @param [Array] searches the matches or listings of the commands to remove def delete(*searches)