bin/tracksperanto in tracksperanto-2.8.5 vs bin/tracksperanto in tracksperanto-2.8.6
- old
+ new
@@ -113,20 +113,13 @@
$code = true
retry
end
input_file = ARGV.pop
-unless input_file
- $stderr.puts "No input file provided - should be the last argument. Also use the --help option."
- exit(1)
-end
+fail "No input file provided - should be the last argument. Also use the --help option." unless input_file
+fail "Input file #{input_file} does not exist" unless File.exist?(input_file)
-unless File.exist?(input_file)
- $stderr.puts "Input file #{input_file} does not exist"
- exit(1)
-end
-
pbar = ProgressBar.new("Converting", 100, $stdout)
progress = lambda do |percent,message|
pbar.set(percent)
if $debug
STDOUT.puts("[%d -> %s]" % [percent, message])
@@ -149,11 +142,10 @@
rescue Tracksperanto::UnknownMiddlewareError => damn
$stderr.puts damn.message
$stderr.puts "This is a bug, please report it"
exit(2)
rescue Exception => damn
- $stderr.puts damn.message
- exit(2)
+ fail damn.message
ensure
pbar.finish
end
puts disclaimer
\ No newline at end of file