Skip to content

Commit

Permalink
Fix broken hosts and services help command
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Feb 9, 2024
1 parent 0c83ad4 commit 72932bd
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions lib/msf/ui/console/command_dispatcher/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,6 @@ def delete_host_tag(rws, tag_name)
[ '-C', '--columns-until-restart' ] => [ true, 'Only show the given columns until the next restart (see list below)', '<columns>' ],
)

def cmd_hosts_help(default_columns)
print_line "Usage: hosts [ options ] [addr1 addr2 ...]"
print_line
print @@hosts_opts.usage
print_line
print_line "Available columns: #{default_columns.join(", ")}"
print_line
end

def cmd_hosts(*args)
return unless active?
onlyup = false
Expand Down Expand Up @@ -487,7 +478,12 @@ def cmd_hosts(*args)
@@hosts_opts.parse(args) do |opt, idx, val|
case opt
when '-h', '--help'
cmd_hosts_help(default_columns)
print_line "Usage: hosts [ options ] [addr1 addr2 ...]"
print_line
print @@hosts_opts.usage
print_line
print_line "Available columns: #{default_columns.join(", ")}"
print_line
return
when '-a', '--add'
mode << :add
Expand Down Expand Up @@ -698,12 +694,12 @@ def cmd_services_tabs(str, words)
[]
end

def cmd_services_help(default_columns)
def cmd_services_help
print_line "Usage: services [-h] [-u] [-a] [-r <proto>] [-p <port1,port2>] [-s <name1,name2>] [-o <filename>] [addr1 addr2 ...]"
print_line
print @@services_opts.usage
print_line
print_line "Available columns: #{default_columns.join(", ")}"
print_line "Available columns: #{@@services_columns.join(", ")}"
print_line
end

Expand Down Expand Up @@ -918,7 +914,7 @@ def cmd_services(*args)
search_term = val
opts[:search_term] = search_term
when '-h', '--help'
cmd_services_help(@@services_columns)
cmd_services_help
return
else
# Anything that wasn't an option is a host to search for
Expand Down

0 comments on commit 72932bd

Please sign in to comment.