1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

added edit-command and reload-command commands to user_command_api.rb set

This commit is contained in:
John Mair 2011-08-02 08:30:13 +11:00
parent f00ec3926a
commit 9708367342

View file

@ -17,6 +17,21 @@ class Pry
end
command "reload-command", "Reload a command. reload-command CMD_NAME CMD_SET" do |command_name, set_name|
cmd = Pry.config.commands.commands[command_name]
load cmd.block.source_location.first
Pry.config.commands.import target.eval(set_name)
Pry.active_instance.commands.import target.eval(set_name)
end
command "edit-command", "Edit a command. edit-command CMD_NAME CMD_SET" do |command_name, set_name|
cmd = Pry.config.commands.commands[command_name]
invoke_editor(*cmd.block.source_location)
load cmd.block.source_location.first
Pry.config.commands.import target.eval(set_name)
Pry.active_instance.commands.import target.eval(set_name)
end
end
end
end