summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-10-05 14:35:56 -0700
committerelijah <elijah@riseup.net>2016-10-05 14:35:56 -0700
commit7abfbd6abae14fa6a72350f7b75268ff561354ee (patch)
treeaf5c969c905a8d2a95f2b2aa7c4dd6f4b8763126 /bin
parentcc57bc6c0ff99d88f3bfeff1b04297e9b91e6988 (diff)
parentf95e08ef7d8defbde4a19e138b1ac4ebc9677669 (diff)
Merge branch 'develop'
# Conflicts: # lib/leap_cli/version.rb
Diffstat (limited to 'bin')
-rwxr-xr-xbin/leap18
1 files changed, 6 insertions, 12 deletions
diff --git a/bin/leap b/bin/leap
index 9cd3518..55ffb41 100755
--- a/bin/leap
+++ b/bin/leap
@@ -14,6 +14,7 @@ else
$VERBOSE=nil
DEBUG=false
end
+TEST = false
LEAP_CLI_BASE_DIR = File.expand_path('..', File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__))
@@ -27,8 +28,6 @@ rescue LoadError
end
require 'gli'
-require 'highline'
-require 'forwardable'
require 'leap_cli/lib_ext/gli' # our custom extensions to gli
#
@@ -40,16 +39,6 @@ require 'leap_cli/lib_ext/gli' # our custom extensions to gli
#
module LeapCli::Commands
extend GLI::App
- extend Forwardable
-
- # delegate highline methods to make them available to sub-commands
- @terminal = HighLine.new
- def_delegator :@terminal, :ask, 'self.ask'
- def_delegator :@terminal, :agree, 'self.agree'
- def_delegator :@terminal, :choose, 'self.choose'
- def_delegator :@terminal, :say, 'self.say'
- def_delegator :@terminal, :color, 'self.color'
- def_delegator :@terminal, :list, 'self.list'
# make config manager available as 'manager'
def self.manager
@@ -90,6 +79,9 @@ module LeapCli::Commands
# run command
begin
+ if ARGV.any?
+ LeapCli.log_raw(:log, nil, "COMMAND") { 'leap ' + ARGV.join(' ') }
+ end
exit_status = run(ARGV)
exit(LeapCli::Util.exit_status || exit_status)
rescue StandardError => exc
@@ -102,6 +94,8 @@ module LeapCli::Commands
end
if DEBUG
raise exc
+ else
+ exit(1)
end
end
end