9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/one44-cli/optparse.rb', line 9
def self.parse(args)
options = {}
option_parser = OptionParser.new do |opts|
opts.on('-r', '--random-sort-questions') do
options[:random_sort_questions] = true
end
opts.on('--not-random-sort-questions') do
options[:random_sort_questions] = false
end
opts.on('-s ORDER', '--sort-questions=ORDER', /^random$/i) do |order|
options[:question_order] = order.downcase.to_sym
end
opts.on('-f TEST', '--path-to-test-file=TEST', '[Mandatory] Specify the path to the test file.') do |test|
options[:test] = test
end
end
process_options(option_parser, options, args)
end
|