aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/leap9
-rw-r--r--lib/leap_cli/commands/pre.rb3
2 files changed, 11 insertions, 1 deletions
diff --git a/bin/leap b/bin/leap
index 582d313..45f64fb 100755
--- a/bin/leap
+++ b/bin/leap
@@ -64,7 +64,14 @@ module LeapCli::Commands
#
program_desc LeapCli::SUMMARY
program_long_desc LeapCli::DESCRIPTION
- version LeapCli::VERSION
+
+ #
+ # handle --version ourselves
+ #
+ if ARGV.grep(/--version/).any?
+ puts "leap #{LeapCli::VERSION}, ruby #{RUBY_VERSION}"
+ exit(0)
+ end
#
# load commands and run
diff --git a/lib/leap_cli/commands/pre.rb b/lib/leap_cli/commands/pre.rb
index d80a9c2..a15a628 100644
--- a/lib/leap_cli/commands/pre.rb
+++ b/lib/leap_cli/commands/pre.rb
@@ -15,6 +15,9 @@ module LeapCli
default_value Path.root
flag [:root]
+ desc 'Display version number and exit'
+ switch :version, :negatable => false
+
pre do |global,command,options,args|
#
# set verbosity