Added the --version commandline parameter.

This commit is contained in:
Paul van Tilburg 2009-07-06 01:48:53 +02:00
parent 654a04f401
commit e0bcda0cf3
1 changed files with 7 additions and 3 deletions

View File

@ -105,9 +105,10 @@ Version = '0.6'
# Determine the compile mode from the options.
mode = :dvi
opts = GetoptLong.new(
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--ps", "-p", GetoptLong::NO_ARGUMENT ],
[ "--pdf", "-d", GetoptLong::NO_ARGUMENT ])
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--ps", "-p", GetoptLong::NO_ARGUMENT ],
[ "--pdf", "-d", GetoptLong::NO_ARGUMENT ],
[ "--version", "-v", GetoptLong::NO_ARGUMENT ])
opts.ordering = GetoptLong::REQUIRE_ORDER
opts.quiet = true
opts.each do |opt, arg|
@ -121,6 +122,9 @@ opts.each do |opt, arg|
mode = if mode == :ps then :pspdf
else :pdf
end
when "--version"
puts "#{Program} #{Version}"
exit 0
end
end