class Basic101::Arguments

Attributes

filenames[R]
randomize[R]
transcript[R]

Public Class Methods

new(argv) click to toggle source
# File lib/basic101/arguments.rb, line 11
def initialize(argv)
  @transcript = false
  @randomize = true
  OptionParser.new do |opts|
    opts.banner << " [PATH]..."
    opts.on('-t', '--transcript',
            'Write transcript of input and output') do |v|
      @transcript = v
    end
    opts.on('--[no-]randomize',
            'Randomize random number generator.',
            'Default is --randomize') do |v|
      @randomize = v
    end
  end.parse!(argv)
  @filenames = argv.dup
rescue OptionParser::ParseError => e
  $stderr.puts e
  exit 1
end