Method: LearnOpen::ArgumentParser#parse

Defined in:
lib/learn_open/argument_parser.rb

#parseObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/learn_open/argument_parser.rb', line 11

def parse
  options = {}
  rest = OptionParser.new do |opts|
    opts.on("--next", "open next lab") do |n|
      options[:next] = n
    end
    opts.on("--editor=EDITOR", "specify editor") do |e|
      options[:editor] = e
    end

    opts.on("--clone-only", "only download files. No shell") do |co|
      options[:clone_only] = co
    end
  end.parse(args)
  options[:lesson_name] = rest.first
  options
end