1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-07-18 18:31:41 +02:00

handle invalid options, fixes 542

git-svn-id: file:///home/svn/framework3/trunk@7643 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
James Lee 2009-11-29 23:47:03 +00:00
parent 05733b9d8d
commit d769b45fdb
4 changed files with 24 additions and 4 deletions

View File

@ -71,7 +71,12 @@ class OptsConsole
end
end
opts.parse!(args)
begin
opts.parse!(args)
rescue OptionParser::InvalidOption
puts "Invalid option, try -h for usage"
exit
end
options
end

View File

@ -76,7 +76,12 @@ opt.on_tail("-h", "--help", "Show this message") do
exit
end
opt.parse!
begin
opt.parse!
rescue OptionParser::InvalidOption
puts "Invalid option, try -h for usage"
exit
end
if (! worker)
puts opt

View File

@ -65,7 +65,12 @@ opt.on_tail("-h", "--help", "Show this message") do
exit(0)
end
opt.parse!
begin
opt.parse!
rescue OptionParser::InvalidOption
puts "Invalid option, try -h for usage"
exit
end
if (! worker)
puts opt

View File

@ -119,7 +119,12 @@ opt.on_tail("-h", "--help", "Show this message") do
exit
end
opt.parse!
begin
opt.parse!
rescue OptionParser::InvalidOption
puts "Invalid option, try -h for usage"
exit
end
if (! worker)
puts opt