Skip to content

Commit

Permalink
Print nicely about what object you're in
Browse files Browse the repository at this point in the history
  • Loading branch information
wvu committed Sep 21, 2018
1 parent 7c000c6 commit fb03274
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/msf/ui/console/command_dispatcher/developer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,20 @@ def cmd_pry(*args)
begin
require 'pry'
rescue LoadError
print_error("Failed to load Pry, try 'gem install pry'")
print_error('Failed to load Pry, try "gem install pry"')
return
end

active_module ? active_module.pry : framework.pry
print_status('Starting Pry shell...')

unless active_module
print_status("You are in the \"framework\" object\n")
framework.pry
return
end

print_status("You are in #{active_module.fullname}\n")
active_module.pry
end

def cmd_edit_help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,13 @@ def cmd_pry(*args)
begin
require 'pry'
rescue LoadError
print_error("Failed to load Pry, try 'gem install pry'")
print_error('Failed to load Pry, try "gem install pry"')
return
end

print_status('Starting Pry shell...')
print_status("You are in the \"client\" (session) object\n")

client.pry
end

Expand Down

0 comments on commit fb03274

Please sign in to comment.