Sha256: 59ea336ebebaad30a5b4ea6dda5a784735fb8a3a5e66ad72b792917c2ff496d6
Contents?: true
Size: 924 Bytes
Versions: 9
Compression:
Stored size: 924 Bytes
Contents
# frozen_string_literal: true require "optparse" module Git module Lint module CLI # Assembles and parses all Command Line Interface (CLI) options. class Parser include Import[:configuration] CLIENT = OptionParser.new nil, 40, " " SECTIONS = [Parsers::Core, Parsers::Analyze].freeze # Order matters. def initialize sections: SECTIONS, client: CLIENT, **dependencies super(**dependencies) @sections = sections @client = client @configuration_duplicate = configuration.dup end def call arguments = [] sections.each { |section| section.call configuration_duplicate, client: } client.parse arguments configuration_duplicate.freeze end def to_s = client.to_s private attr_reader :sections, :client, :configuration_duplicate end end end end
Version data entries
9 entries across 9 versions & 1 rubygems