lib/yard/cli/graph.rb in yard-0.8.2.1 vs lib/yard/cli/graph.rb in yard-0.8.3
- old
+ new
@@ -18,11 +18,11 @@
# A command-line utility to generate Graphviz graphs from
# a set of objects
#
# @see Graph#run
# @since 0.6.0
- class Graph < Command
+ class Graph < YardoptsCommand
# The options parsed out of the commandline.
# Default options are:
# :format => :dot
attr_reader :options
@@ -30,10 +30,11 @@
attr_reader :objects
# Creates a new instance of the command-line utility
def initialize
super
+ @use_document_file = false
@options = GraphOptions.new
options.reset_defaults
options.serializer = YARD::Serializers::StdoutSerializer.new
end
@@ -46,21 +47,23 @@
# @example
# grapher = Graph.new
# grapher.run('--private')
# @param [Array<String>] args each tokenized argument
def run(*args)
+ parse_arguments(*args)
Registry.load
- optparse(*args)
contents = objects.map do |o|
o.format(options.merge(:serialize => false))
end.join("\n")
opts = {:type => :layout, :contents => contents}
options.update(opts)
Templates::Engine.render(options)
end
private
+
+ def unrecognized_option(err) end
# Parses commandline options.
# @param [Array<String>] args each tokenized argument
def optparse(*args)
visibilities = []