module MagentoRemote::CLI::Options

Public Class Methods

add_shop_options(opts, options) click to toggle source

Register customer, password and base-uri options.

# File lib/bin_helper.rb, line 6
def self.add_shop_options opts, options
  opts.separator "Magento shop options"

  opts.on('-u', '--customer USER',
    'customer/username of shop.') do |u|
    options[:user] = u
  end

  opts.on('-p', '--password PASSWORD',
    'password of customer account.') do |p|
    options[:pass] = p
  end

  opts.on('-b', '--base-uri URI',
    'base URI of shop.') do |b|
    options[:base_uri] = b
  end
end
exit_obligatory!(options) click to toggle source

Exit if obligatory options not given.

# File lib/bin_helper.rb, line 26
def self.exit_obligatory! options
  if !options[:user] || !options[:pass] || !options[:base_uri]
    STDERR.puts "Error: You have to define user, pass and base_uri.  (see --help)"
    exit 1
  end
end