aboutsummaryrefslogtreecommitdiff
path: root/bin/keyringer
diff options
context:
space:
mode:
Diffstat (limited to 'bin/keyringer')
-rwxr-xr-xbin/keyringer23
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/keyringer b/bin/keyringer
index c643369..098719b 100755
--- a/bin/keyringer
+++ b/bin/keyringer
@@ -25,20 +25,25 @@ require 'keyringer'
begin
Keyringer::Parser.new
- action = Keyringer::Actions.const_get($action.capitalize)
-
- if action.is_a?(Class)
- instance = action.new
- output = instance.execute
- puts output
+ puts "Performing action #{$action.capitalize}"
+ begin
+ action = Keyringer::Actions.const_get($action.capitalize)
+ rescue NameError
+ wrapper = Keyringer::BashWrapper.new
+ wrapper.execute
+ else
+ if action.is_a?(Class)
+ instance = action.new
+ output = instance.execute
+ puts output
+ end
end
-rescue NameError
- wrapper = Keyringer::BashWrapper.new
- wrapper.execute
rescue SystemExit => e
exit e.status
rescue Exception => e
puts "Fatal error: #{e.inspect}"
+ puts e.backtrace.join("\n")
+
exit 1
end