Sha256: f3943b640f1869ff38213729bfa610227971bf5e930452eb18d12e1e49b4b09a
Contents?: true
Size: 833 Bytes
Versions: 10
Compression:
Stored size: 833 Bytes
Contents
# frozen_string_literal: true require "optparse" module Milestoner module CLI # Assembles and parses all Command Line Interface (CLI) options. class Parser include Import[:configuration] CLIENT = OptionParser.new nil, 40, " " SECTIONS = [Parsers::Core].freeze 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
Version data entries
10 entries across 10 versions & 1 rubygems