lib/asciidoctor/reducer/cli.rb in asciidoctor-reducer-1.0.0.alpha.2 vs lib/asciidoctor/reducer/cli.rb in asciidoctor-reducer-1.0.0.alpha.3
- old
+ new
@@ -6,11 +6,11 @@
module Asciidoctor::Reducer
autoload :VERSION, (::File.join __dir__, 'version.rb')
class Cli
def parse args
- options = { attributes: {}, safe: :safe }
+ options = { attributes: {}, safe: :unsafe }
opt_parser = ::OptionParser.new do |opts|
opts.program_name = 'asciidoctor-reducer'
opts.banner = <<~EOS
Usage: #{opts.program_name} [OPTION]... FILE
@@ -89,10 +89,10 @@
else
reduced = (::Asciidoctor.load_file input_file, (options.merge to_file: false)).source + ?\n
end
::Pathname === to ? (to.write reduced, encoding: ::Encoding::UTF_8) : (to.write reduced)
0
- rescue ::IOError
+ rescue
$stderr.write %(asciidoctor-reducer: #{$!.message}\n)
1
ensure
::Asciidoctor::LoggerManager.logger = old_logger
end