lib/rails_erd/cli.rb in rails-erd-1.5.2 vs lib/rails_erd/cli.rb in rails-erd-1.6.0
- old
+ new
@@ -1,5 +1,6 @@
+require "rails_erd"
require "choice"
Choice.options do
separator ""
separator "Diagram options:"
@@ -123,10 +124,16 @@
require "rails_erd/version"
$stderr.puts RailsERD::BANNER
exit
end
end
+
+ option :config_file do
+ short "-c"
+ long "--config=FILENAME"
+ desc "Configuration file to use"
+ end
end
module RailsERD
class CLI
attr_reader :path, :options
@@ -140,9 +147,12 @@
elsif value.to_s.include? ","
opts[key.to_sym] = value.split(",").map(&:to_s)
else
opts[key.to_sym] = value
end
+ end
+ if options[:config_file] && options[:config_file] != ''
+ RailsERD.options = RailsERD.default_options.merge(Config.load(options[:config_file]))
end
new(path, options).start
end
end