Sha256: 3bd2a3e08dc1420e3dafa180d33c635b17a58e5439f20545c174c593601a9a3c

Contents?: true

Size: 981 Bytes

Versions: 5

Compression:

Stored size: 981 Bytes

Contents

# frozen_string_literal: true

require "core"
require "refinements/structs"

module Git
  module Lint
    module CLI
      module Parsers
        # Handles parsing of Command Line Interface (CLI) core options.
        class Analyze
          using ::Refinements::Structs

          def self.call(...) = new(...).call

          def initialize configuration = Container[:configuration], client: Parser::CLIENT
            @configuration = configuration
            @client = client
          end

          def call arguments = ::Core::EMPTY_ARRAY
            client.separator "\nANALYZE OPTIONS:\n"
            add_sha
            client.parse arguments
            configuration
          end

          private

          attr_reader :configuration, :client

          def add_sha
            client.on "--sha HASH", "Analyze specific commit SHA." do |sha|
              configuration.merge! analyze_sha: sha
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
git-lint-5.3.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-5.2.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-5.1.2 lib/git/lint/cli/parsers/analyze.rb
git-lint-5.1.1 lib/git/lint/cli/parsers/analyze.rb
git-lint-5.1.0 lib/git/lint/cli/parsers/analyze.rb