Skip to content

Commit

Permalink
Adds --debug switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jutonz committed Nov 10, 2015
1 parent f640a9b commit 044a1c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion bin/whereto
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ command :organize do |cmd|
cmd.default_value '.mkv'
cmd.flag [:e, :ext]

cmd.desc 'Print a full stack trace on error. Useful for debugging.'
cmd.default_value false
cmd.switch :debug, negatable: false

cmd.desc "Run normally, but don't actually perform renames"
cmd.default_value false
cmd.switch :dryrun, negatable: false
Expand Down Expand Up @@ -143,7 +147,12 @@ end
on_error do |exception|
# Error logic here
# return false to skip default error handling
true
if @options && @options[:debug]
puts exception.backtrace
false
else
true
end
end

exit run(ARGV)
2 changes: 1 addition & 1 deletion lib/where_to/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module WhereTo
VERSION = "1.0.3"
VERSION = "1.0.4"
end

0 comments on commit 044a1c4

Please sign in to comment.