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:
parent
f00ec3926a
commit
9708367342
1 changed files with 15 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue