class Wavefront::Cli

Parent of all the CLI classes.

Attributes

arguments[RW]
noop[RW]
options[RW]

Public Class Methods

new(options, arguments) click to toggle source
# File lib/wavefront/cli.rb, line 26
def initialize(options, arguments)
  @options   = options
  @arguments = arguments
  @noop = options[:noop]

  if options.include?(:help) && options[:help]
    puts options
    exit 0
  end
end

Public Instance Methods

validate_opts() click to toggle source
# File lib/wavefront/cli.rb, line 37
def validate_opts
  #
  # There are things we need to have. If we don't have them,
  # stop the user right now. Also, if we're in debug mode, print
  # out a hash of options, which can be very useful when doing
  # actual debugging. Some classes may have to override this
  # method. The writer, for instance, uses a proxy and has no
  # token.
  #
  raise 'Please supply an API token.' unless options[:token]
  raise 'Please supply an API endpoint.' unless options[:endpoint]
end