Skip to content

Commit 7a900cc

Browse files
committed
More Ruby-ish way for cmd_get
1 parent 8aff50a commit 7a900cc

File tree

1 file changed

+3
-5
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+3
-5
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,21 +2318,19 @@ def cmd_get(*args)
23182318
end
23192319

23202320
# Determine which data store we're operating on
2321-
if (active_module and global == false)
2321+
if (active_module && !global)
23222322
datastore = active_module.datastore
23232323
else
23242324
datastore = framework.datastore
23252325
end
23262326

23272327
# No arguments? No cookie.
2328-
if (args.length == 0)
2328+
if args.empty?
23292329
global ? cmd_getg_help : cmd_get_help
23302330
return false
23312331
end
23322332

2333-
while ((val = args.shift))
2334-
print_line("#{val} => #{datastore[val]}")
2335-
end
2333+
args.each { |var| print_line("#{var} => #{datastore[var]}") }
23362334
end
23372335

23382336
#

0 commit comments

Comments
 (0)