bin/sixword in sixword-0.3.1 vs bin/sixword in sixword-0.3.2
- old
+ new
@@ -53,10 +53,14 @@
opts.on('-h', '--help', 'Display this message', ' ') do
$stderr.puts opts, ''
exit 0
end
+ opts.on('-v', '--version', 'Print version number', ' ') do
+ puts 'sixword ' + Sixword::VERSION
+ exit 0
+ end
#
opts.on('-d', '--decode', 'Decode data') do
options[:mode] = :decode
@@ -85,10 +89,15 @@
opts.on('-f', '--fingerprint', 'Short for --hex-style fingerprint') do
options[:hex_style] = 'fingerprint'
end
end
- optparse.parse!
+ begin
+ optparse.parse!
+ rescue OptionParser::InvalidOption => err
+ puts_err(err.message)
+ exit 1
+ end
case ARGV.length
when 0
filename = '-'
when 1