Sha256: 88e062d9eba04c74d12b276de87d4cfc1350469fda3dacf6dd43a7b9a1443a53

Contents?: true

Size: 998 Bytes

Versions: 14

Compression:

Stored size: 998 Bytes

Contents

# frozen_string_literal: true

require 'i18n/tasks/command/dsl'

module I18n::Tasks
  module Command
    module Options
      module Common
        include Command::DSL

        arg :nostdin,
            '-S',
            '--nostdin',
            t('i18n_tasks.cmd.args.desc.nostdin')

        arg :confirm,
            '-y',
            '--confirm',
            desc: t('i18n_tasks.cmd.args.desc.confirm')

        arg :pattern,
            '-p',
            '--pattern PATTERN',
            t('i18n_tasks.cmd.args.desc.key_pattern')

        arg :value,
            '-v',
            '--value VALUE',
            t('i18n_tasks.cmd.args.desc.value')

        arg :config,
            '-c',
            '--config FILE',
            t('i18n_tasks.cmd.args.desc.config')


        def arg_or_pos!(key, opts)
          opts[key] ||= opts[:arguments].try(:shift)
        end

        def pos_or_stdin!(opts)
          opts[:arguments].try(:shift) || $stdin.read
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
i18n-tasks-1.0.9 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.8 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.7 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.6 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.5 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.4 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.3 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.2 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.1 lib/i18n/tasks/command/options/common.rb
i18n-tasks-1.0.0 lib/i18n/tasks/command/options/common.rb
i18n-youdao-tasks-0.9.37 lib/i18n/tasks/command/options/common.rb
i18n-tasks-0.9.37 lib/i18n/tasks/command/options/common.rb
i18n-tasks-0.9.36 lib/i18n/tasks/command/options/common.rb
i18n-tasks-0.9.35 lib/i18n/tasks/command/options/common.rb