Skip to content

Commit

Permalink
print help when no mode is selected
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/svn/framework3/trunk@12862 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information
bannedit committed Jun 5, 2011
1 parent 06473b0 commit 650c125
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions msfbinscan
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,21 @@ opt.on('-F', '--filter-addresses [regex]', 'Filter addresses based on a regular
end

opt.on_tail("-h", "--help", "Show this message") do
puts opt
$stderr.puts opt
exit(1)
end

begin
opt.parse!
rescue OptionParser::InvalidOption
puts "Invalid option, try -h for usage"
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
$stderr.puts "Invalid option, try -h for usage"
exit(1)
end

if not mode or mode.nil?

if mode.empty?
$stderr.puts "A mode must be selected"
$stderr.puts opt
exit(1)
end

Expand Down

0 comments on commit 650c125

Please sign in to comment.