aboutsummaryrefslogtreecommitdiff
path: root/bin/keyringer
diff options
context:
space:
mode:
Diffstat (limited to 'bin/keyringer')
-rwxr-xr-xbin/keyringer20
1 files changed, 11 insertions, 9 deletions
diff --git a/bin/keyringer b/bin/keyringer
index 74dfcb1..d6ab3d4 100755
--- a/bin/keyringer
+++ b/bin/keyringer
@@ -12,16 +12,18 @@ end
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'keyringer'
begin
- action = Keyringer.const_get(ARGV[1].capitalize)
-
- if action.is_a?(Class)
- instance = action.new
- output = instance.execute
- puts output
+ begin
+ action = Keyringer.const_get(ARGV[1].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