mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-09 04:26:11 +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:
parent
05733b9d8d
commit
d769b45fdb
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user