Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow --debug to print backtraces

  • Loading branch information...
commit fcb2f1fce2b16702ee7e1b8a9bf94eea9330d3a1 1 parent 76172ad
@ddollar authored
Showing with 4 additions and 3 deletions.
  1. +0 −2  bin/mason
  2. +4 −1 lib/mason/cli.rb
View
2  bin/mason
@@ -8,6 +8,4 @@ begin
Mason::CLI.run
rescue Errno::EPIPE
rescue Mason::CommandFailed => ex
- $stderr.puts " ! #{ex}"
- exit 1
end
View
5 lib/mason/cli.rb
@@ -7,6 +7,7 @@
class Mason::CLI < Thor
+ class_option :debug, :type => :boolean, :desc => "show backtraces"
class_option :help, :type => :boolean, :aliases => "-h", :desc => "help for this command"
map %w( -v -V --version ) => :version
@@ -236,7 +237,9 @@ def self.run
klass.start(args)
rescue StandardError => ex
- raise Mason::CommandFailed, ex.message
+ $stderr.puts " ! #{ex}"
+ $stderr.puts " " + ex.backtrace.join("\n ") if ARGV.include?("--debug")
+ exit 1
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.