From 3f98511d7c5dd0623af999719a0ea15f6e3aba4a Mon Sep 17 00:00:00 2001 From: Chris Doughty Date: Tue, 29 Dec 2015 15:11:16 -0600 Subject: [PATCH] Cleanup logic to force an output type --- lib/msf/ui/console/command_dispatcher/core.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 558e0d34cc..7d77ff7864 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -761,8 +761,11 @@ class Core if (args.length == 0) if (active_module) - print(Serializer::Json.dump_module(active_module)) if dump_json - print(Serializer::ReadableText.dump_module(active_module)) if dump_json + if dump_json + print(Serializer::Json.dump_module(active_module)) + else + print(Serializer::ReadableText.dump_module(active_module)) + end return true else cmd_info_help @@ -778,9 +781,10 @@ class Core if (mod == nil) print_error("Invalid module: #{name}") + elsif dump_json + print(Serializer::Json.dump_module(mod)) else - print(Serializer::Json.dump_module(mod)) if dump_json - print(Serializer::ReadableText.dump_module(mod)) if dump_json + print(Serializer::ReadableText.dump_module(mod)) end } end