lib/rails_erd/cli.rb in rails-erd-1.3.0 vs lib/rails_erd/cli.rb in rails-erd-1.3.1
- old
+ new
@@ -55,10 +55,22 @@
option :exclude do
long "--exclude"
desc "Filter to exclude listed models in diagram."
end
+ option :sort do
+ long "--sort=BOOLEAN"
+ desc "Sort attribute list alphabetically"
+ default "false"
+ end
+
+ option :prepend_primary do
+ long "--prepend_primary=BOOLEAN"
+ desc "Ensure primary key is at start of attribute list"
+ default "false"
+ end
+
separator ""
separator "Output options:"
option :filename do
long "--filename=FILENAME"
@@ -116,10 +128,10 @@
path = Choice.rest.first || Dir.pwd
options = Choice.choices.each_with_object({}) do |(key, value), opts|
if key.start_with? "no_"
opts[key.gsub("no_", "").to_sym] = !value
elsif value.to_s.include? ","
- opts[key.to_sym] = value.split(",").map(&:to_sym)
+ opts[key.to_sym] = value.split(",").map(&:to_s)
else
opts[key.to_sym] = value
end
end
new(path, options).start