summaryrefslogtreecommitdiff
path: root/exe
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-12-27 16:19:02 -0700
committermo khan <mo.khan@gmail.com>2019-12-27 16:19:02 -0700
commit2d87d15728e45f7a7dc4ab4f2bab6881712644eb (patch)
treedeb4d4d126aec16cdee677dacb42bd0b1c55a344 /exe
parent6e9f360f9afeb070d09b9c838423a81a50e05061 (diff)
Install tty
Diffstat (limited to 'exe')
-rwxr-xr-xexe/spandx16
1 files changed, 15 insertions, 1 deletions
diff --git a/exe/spandx b/exe/spandx
index 4e2f5a8..57aad5f 100755
--- a/exe/spandx
+++ b/exe/spandx
@@ -1,4 +1,18 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
-require 'spandx'
+lib_path = File.expand_path('../lib', __dir__)
+$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
+require 'spandx/cli'
+
+Signal.trap('INT') do
+ warn("\n#{caller.join("\n")}: interrupted")
+ exit(1)
+end
+
+begin
+ Spandx::CLI.start
+rescue Spandx::CLI::Error => error
+ puts "ERROR: #{error.message}"
+ exit 1
+end