Update cmd_hosts

bug/bundler_fix
William Vu 2016-12-20 23:32:10 -06:00
parent ad7b3dac2d
commit 574ebd07d7
1 changed files with 9 additions and 2 deletions

View File

@ -360,6 +360,11 @@ class Db
onlyup = true
when '-o'
output = args.shift
when '-O'
if (order_by = args.shift.to_i - 1) < 0
print_error('Please specify a column number starting from 1')
return
end
when '-R', '--rhosts'
set_rhosts = true
when '-S', '--search'
@ -386,6 +391,7 @@ class Db
print_line " -h,--help Show this help information"
print_line " -u,--up Only show hosts which are up"
print_line " -o <file> Send output to a file in csv format"
print_line " -O <column> Order rows by specified column number"
print_line " -R,--rhosts Set RHOSTS from the results of the search"
print_line " -S,--search Search string to filter by"
print_line " -i,--info Change the info of a host"
@ -425,8 +431,9 @@ class Db
# If we got here, we're searching. Delete implies search
tbl = Rex::Text::Table.new(
{
'Header' => "Hosts",
'Columns' => col_names,
'Header' => "Hosts",
'Columns' => col_names,
'SortIndex' => order_by
})
# Sentinal value meaning all