lib/yard/cli/yardoc.rb in yard-0.5.3 vs lib/yard/cli/yardoc.rb in yard-0.5.4

- old
+ new

@@ -321,10 +321,18 @@ opts.on('-o', '--output-dir PATH', 'The output directory. (defaults to ./doc)') do |dir| options[:serializer] = nil serialopts[:basepath] = dir end + + opts.on('--charset ENC', 'Character set to use for HTML output (default is utf-8)') do |encoding| + begin + Encoding.default_external = encoding + rescue ArgumentError => e + raise OptionParser::InvalidOption, e + end + end opts.on('-t', '--template TEMPLATE', 'The template to use. (defaults to "default")') do |template| options[:template] = template.to_sym end @@ -338,17 +346,10 @@ 'The output format for the template. (defaults to html)') do |format| options[:format] = format.to_sym end common_options(opts) - - begin - opts.parse!(args) - rescue OptionParser::InvalidOption => e - STDERR.puts e.message - STDERR << "\n" << opts - exit - end + parse_options(opts, args) # Last minute modifications build_gems(do_rebuild_gems) if do_build_gems parse_files(*args) unless args.empty? self.files = ['lib/**/*.rb', 'ext/**/*.c'] if self.files.empty?