module Mixlib::CLI

def parse_options(argv=ARGV)

argv:: Returns any un-parsed elements.
=== Returns

argv:: The array of arguments to parse; defaults to ARGV
=== Parameters
the class level).
Parses an array, by default ARGV, for command line options (as configured at
def parse_options(argv=ARGV)
  argv = argv.dup
  opt_parser.parse!(argv)
  # Deal with any required values
  options.each do |opt_key, opt_value|
    if opt_value[:required] && !config.has_key?(opt_key)
      reqarg = opt_value[:short] || opt_value[:long]
      puts "You must supply #{reqarg}!"
      puts @opt_parser
      exit 2
    end
  end
  @cli_arguments = argv
  argv
end