lib/tocer/cli/parser.rb in tocer-13.0.2 vs lib/tocer/cli/parser.rb in tocer-13.1.0

- old
+ new

@@ -7,14 +7,14 @@ # Assembles and parses all Command Line Interface (CLI) options. class Parser CLIENT = OptionParser.new nil, 40, " " SECTIONS = [Parsers::Core, Parsers::Flag].freeze # Order is important. - def initialize configuration = Configuration::Loader.call, sections: SECTIONS, client: CLIENT - @configuration = configuration.dup + def initialize sections: SECTIONS, client: CLIENT, container: Container @sections = sections @client = client + @configuration = container[:configuration].dup end def call arguments = [] sections.each { |parser| parser.call configuration, client: } client.parse arguments @@ -23,9 +23,9 @@ def to_s = client.to_s private - attr_reader :configuration, :sections, :client + attr_reader :sections, :client, :configuration end end end