Sha256: 6709b5fe09f8a3f16145f599a7cbf929ccce2523f9e475940b8ef218a1d23e93

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

require_relative '../util'

class I18nFlow::CLI
  class CommandBase
    attr_reader(*%i[
      args
      options
    ])

    def initialize(args)
      @args    = args.dup
      @options = I18nFlow::Util::parse_options(@args)
    end

    def invoke!
      raise 'Not implemented'
    end

    def exit_with_message(status, *args)
      if status.zero?
        puts(*args)
      else
        $stderr.puts(*args)
      end

      exit status
    end

    def color_enabled?
      options['nocolor'].nil?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i18n_flow-0.2.3 lib/i18n_flow/cli/command_base.rb
i18n_flow-0.2.2 lib/i18n_flow/cli/command_base.rb
i18n_flow-0.2.1 lib/i18n_flow/cli/command_base.rb
i18n_flow-0.2.0 lib/i18n_flow/cli/command_base.rb
i18n_flow-0.1.0 lib/i18n_flow/cli/command_base.rb