Sha256: 2c380a51871c50041ad9b5047e8e9b26ea0df2abd04179a5fb2e21bb212d7156
Contents?: true
Size: 775 Bytes
Versions: 8
Compression:
Stored size: 775 Bytes
Contents
# frozen_string_literal: true require "skunk/cli/options/argv" require "rubycritic/cli/options/file" module Skunk module Cli # Knows how to parse options passed to the CLI application class Options attr_reader :argv_options, :file_options def initialize(argv) @argv_options = Argv.new(argv) @file_options = RubyCritic::Cli::Options::File.new end def parse argv_options.parse file_options.parse self end # :reek:NilCheck def to_h file_hash = file_options.to_h argv_hash = argv_options.to_h file_hash.merge(argv_hash) do |_, file_option, argv_option| Array(argv_option).empty? ? file_option : argv_option end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems