From 4ecbf7fe7943837892cb28151910fc7c64d8c060 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Sat, 13 Apr 2013 11:35:52 +0200 Subject: [PATCH] Fixes #153 Disable error trace when it's from the main script --- wpscan.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/wpscan.rb b/wpscan.rb index c94ed92e..851aaa41 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -15,14 +15,13 @@ def main unless wpscan_options.has_options? usage() - puts red('No argument supplied') - exit(0) + raise('No argument supplied') end if wpscan_options.help help() usage() - exit + exit(1) end # Check for updates @@ -321,9 +320,13 @@ def main puts green("[+] Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}") exit() # must exit! rescue => e - puts red("[ERROR] #{e.message}") - puts red('Trace :') - puts red(e.backtrace.join("\n")) + if e.backtrace[0] =~ /main/ + puts red(e.message) + else + puts red("[ERROR] #{e.message}") + puts red('Trace :') + puts red(e.backtrace.join("\n")) + end end end