Module: Akabei::CLI::CommonOptions

Included in:
Akabei::CLI
Defined in:
lib/akabei/cli.rb

Constant Summary collapse

COMMON_OPTIONS =
{
  repo_key: {
    desc: 'GPG key to sign repository database',
    banner: 'GPGKEY',
    type: :string
  },
  repo_name: {
    desc: 'Name of the repository',
    banner: 'NAME',
    type: :string,
    required: true,
  },
  srcdest: {
    desc: 'Path to the directory to store sources',
    banner: 'FILE',
    type: :string,
  },
}.freeze

Instance Method Summary collapse

Instance Method Details

#common_options(*opts) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/akabei/cli.rb', line 36

def common_options(*opts)
  opts.each do |opt|
    unless COMMON_OPTIONS.has_key?(opt)
      raise "No such common option: #{opt}"
    end
    option(opt, COMMON_OPTIONS[opt])
  end
end