lib/ronin/ui/command_line/command_line.rb in ronin-0.1.2 vs lib/ronin/ui/command_line/command_line.rb in ronin-0.1.3

- old
+ new

@@ -1,11 +1,11 @@ # #-- # Ronin - A Ruby platform designed for information security and data # exploration tasks. # -# Copyright (c) 2006-2008 Hal Brodigan (postmodern.mod3 at gmail.com) +# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. @@ -99,10 +99,15 @@ else cmd = argv.first argv = argv[1..-1] if CommandLine.has_command?(cmd) - CommandLine.commands_by_name[cmd].run(*argv) + begin + CommandLine.commands_by_name[cmd].run(*argv) + rescue => excp + STDERR.puts excp + exit -1 + end else CommandLine.fail("unknown command #{cmd.dump}") end end rescue OptionParser::MissingArgument, OptionParser::InvalidOption => e