lib/gizzmo.rb in gizzmo-0.3.0 vs lib/gizzmo.rb in gizzmo-0.3.1

- old
+ new

@@ -14,10 +14,12 @@ subcommand_options = OpenStruct.new # Leftover arguments argv = nil +GIZZMO_VERSION = File.read(File.dirname(__FILE__) + "/../VERSION") rescue "unable to read version file" + begin YAML.load_file(File.join(ENV["HOME"], ".gizzmorc")).each do |k, v| global_options.send("#{k}=", v) end rescue Errno::ENOENT @@ -134,9 +136,14 @@ global_options.log = file end opts.on("-f", "--force", "Don't display confirmation dialogs") do |force| global_options.force = force + end + + opts.on_tail("-v", "--version", "Show version") do + puts GIZZMO_VERSION + exit end end # Print banner if no args if ARGV.length == 0 \ No newline at end of file