From cc4da0210d86940a300a59f0659d55c70c3b21c7 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 13 Jun 2011 16:38:36 +0200 Subject: [PATCH] feature #661: Add version option --- src/cli/command_parser.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index 6bd89019a3..b44bd401e2 100755 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -30,6 +30,12 @@ module CommandParser :short => "-h", :large => "--help", :description => "Show this message" + }, + VERSION={ + :name => "version", + :short => "-V", + :large => "--version", + :description => "Show version and copyright information", } ] @@ -264,7 +270,9 @@ module CommandParser e[:proc].call elsif e[:name]=="help" help - #puts opts + exit + elsif e[:name]=="version" + puts @version exit else @options[e[:name].to_sym]=o