Sha256: 2bf0774b4983209dc42780fb3adbc9c79d32ee86263e3c02254e5be2f0909cd4

Contents?: true

Size: 949 Bytes

Versions: 17

Compression:

Stored size: 949 Bytes

Contents

# frozen_string_literal: true

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 = []
            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

17 entries across 17 versions & 1 rubygems

Version Path
git-lint-5.0.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.6.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.5.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.4.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.3.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.2.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.1.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.0.1 lib/git/lint/cli/parsers/analyze.rb
git-lint-4.0.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.3.2 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.3.1 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.3.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.2.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.1.0 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.0.2 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.0.1 lib/git/lint/cli/parsers/analyze.rb
git-lint-3.0.0 lib/git/lint/cli/parsers/analyze.rb