mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Add an add_command method to command sets
This is to accomodate people who want to make their own Command subclasses
This commit is contained in:
parent
4fe5f70447
commit
7c5d55d354
1 changed files with 6 additions and 0 deletions
|
@ -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<String>] searches the matches or listings of the commands to remove
|
||||
def delete(*searches)
|
||||
|
|
Loading…
Add table
Reference in a new issue