control_freak.rb
def parse(args)
    @options = Options.new
    @args = OptionParser.new do |parser|
      @options.define_options(parser)
      begin
        parser.parse!(args)
      rescue OptionParser::InvalidOption => e
        puts e.message
        exit
      end
    end
    @options
  rescue OptionParser::MissingArgument => e
    puts e.message
    exit
  end
# Create a structure that describes the options
Create a structure that describes the options
Create a structure that describes the options
def parse(args)
    @options = Options.new
    @args = OptionParser.new do |parser|
      @options.define_options(parser)
      begin
        parser.parse!(args)
      rescue OptionParser::InvalidOption => e
        puts e.message
        exit
      end
    end
    @options
  rescue OptionParser::MissingArgument => e
    puts e.message
    exit
  end
def parse ( args ) @options = Options . new @args = OptionParser . new do | parser | @options . define_options ( parser ) begin parser . parse! ( args ) rescue OptionParser :: InvalidOption => e puts e . message exit end end @options rescue OptionParser :: MissingArgument => e puts e . message exit end
Create a structure that describes the options
Create a structure that describes the options
args