Rename function, change args from to

GSoC/Meterpreter_Web_Console
Erin Bleiweiss 2018-09-26 17:55:43 -05:00
parent 0b48d2371d
commit f8984c4f9b
No known key found for this signature in database
GPG Key ID: F69B2138BD594660
1 changed files with 18 additions and 16 deletions

View File

@ -51,6 +51,18 @@ class Msf::Ui::Console::CommandDispatcher::Developer
load path load path
end end
def reload_diff_files
output = %x(git diff --name-only 2>&1)
if output.include?('Not a git repository')
print_error 'No git repository found.'
return
end
files = output.split("\n")
files.each do | file |
reload_file(file)
end
end
def cmd_irb_help def cmd_irb_help
print_line "Usage: irb" print_line "Usage: irb"
print_line print_line
@ -192,10 +204,12 @@ class Msf::Ui::Console::CommandDispatcher::Developer
end end
def cmd_reload_lib_help def cmd_reload_lib_help
print_line 'Usage: reload_lib lib/to/reload.rb [...] [diff]' print_line 'Usage: reload_lib lib/to/reload.rb [...]'
print_line print_line
print_line 'Reload one or more library files from specified paths.' print_line 'Reload one or more library files from specified paths.'
print_line 'Use the argument \'diff\' to reload all changed files in your current git working tree.' print_line
print_line 'OPTIONS:'
print_line ' -a, --all Reload all changed files in your current git working tree.'
end end
# #
@ -205,8 +219,8 @@ class Msf::Ui::Console::CommandDispatcher::Developer
if args.empty? || args.include?('-h') || args.include?('--help') if args.empty? || args.include?('-h') || args.include?('--help')
cmd_reload_lib_help cmd_reload_lib_help
return return
elsif args.include?('diff') elsif args.include?('-a') || args.include?('--all')
cmd_reload_diff_files reload_diff_files
return return
end end
@ -220,18 +234,6 @@ class Msf::Ui::Console::CommandDispatcher::Developer
tab_complete_filenames(str, words) tab_complete_filenames(str, words)
end end
def cmd_reload_diff_files
output = %x(git diff --name-only 2>&1)
if output.include?('Not a git repository')
print_error 'No git repository found.'
return
end
files = output.split
files.each do | file |
reload_file(file)
end
end
def cmd_log_help def cmd_log_help
print_line 'Usage: log' print_line 'Usage: log'
print_line print_line