lib/pragmater/cli.rb in pragmater-5.0.1 vs lib/pragmater/cli.rb in pragmater-5.0.2

- old
+ new

@@ -36,21 +36,18 @@ map %w[-a --add] => :add method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, - default: [] + default: configuration.to_h.dig(:add, :comments) method_option :includes, - aliases: "-w", + aliases: "-i", desc: "File include list", type: :array, - default: [] + default: configuration.to_h.dig(:add, :includes) def add path = "." - settings = configuration.merge add: { - comments: options[:comments], - includes: options[:includes] - } + settings = configuration.merge add: {comments: options.comments, includes: options.includes} runner = Runner.new path, comments: settings.dig(:add, :comments), includes: settings.dig(:add, :includes) @@ -61,19 +58,19 @@ map %w[-r --remove] => :remove method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, - default: [] + default: configuration.to_h.dig(:remove, :comments) method_option :includes, - aliases: "-w", + aliases: "-i", desc: "File include list", type: :array, - default: [] + default: configuration.to_h.dig(:remove, :includes) def remove path = "." settings = configuration.merge remove: { - comments: options[:comments], - includes: options[:includes] + comments: options.comments, + includes: options.includes } runner = Runner.new path, comments: settings.dig(:remove, :comments), includes: settings.dig(:remove, :includes)