dazzl-tv/evostream-event

View on GitHub
lib/evostream/cli/option/config.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Evostream
  module CLI
    module Argument
      # Argument for precise configuration file used
      class Config < Arg
        include Singleton

        KEY = ['--config'].freeze

        private

        def action
          path = parameter('--config')
          CLI::Config.instance.load_custom_file(File.join(path))
        rescue
          raise CodeError::Syntax::OptionInvalid
        end
      end
    end
  end
end