diff --git a/lib/rex/ui/text/dispatcher_shell.rb b/lib/rex/ui/text/dispatcher_shell.rb index 55ae2a61f8..ab38be652a 100644 --- a/lib/rex/ui/text/dispatcher_shell.rb +++ b/lib/rex/ui/text/dispatcher_shell.rb @@ -453,6 +453,8 @@ module DispatcherShell run_command(dispatcher, method, arguments) found = true end + rescue OptionParser::ParseError + print_error("#{method}: #{e.message}") rescue error = $! @@ -490,8 +492,6 @@ module DispatcherShell else dispatcher.send('cmd_' + method, *arguments) end - rescue OptionParser::ParseError => e - print_error("#{method}: #{e.message}") ensure self.busy = false end