make session query/shares help menu more explicit

This commit is contained in:
Zach Goldman 2024-03-19 11:21:06 -05:00
parent 923f4c9f7b
commit 2c9ade955e
2 changed files with 18 additions and 7 deletions

View File

@ -134,22 +134,33 @@ module Rex
end
def cmd_query(*args)
@@query_opts.parse(args) do |opt, idx, val|
show_help = false
call_interactive = false
@@query_opts.parse(args) do |opt, _idx, val|
case opt
when nil
show_help = true if val == 'help'
break
when '-h', '--help'
cmd_query_help
return
show_help = true
break
when '-i', '--interact'
cmd_query_interactive
return
call_interactive = true
break
end
end
if args.empty?
if args.empty? || show_help
cmd_query_help
return
end
if call_interactive
cmd_query_interactive
return
end
result = run_query(args.join(' '))
case result[:status]
when :success

View File

@ -663,7 +663,7 @@ module DispatcherShell
str << dispatcher.help_to_s(opts.merge({ command_width: [max_command_length, 12].max }))
}
return str
return str << "For more info on a specific command, use %grn<command> -h%clr or %grnhelp <command>%clr.\n\n"
end