Module: MandatoryOptions

Included in:
OptParserInternal
Defined in:
lib/gitarro/opt_parser.rb

Overview

this are the mandatory options

Instance Method Summary collapse

Instance Method Details

#context_opt(opt) ⇒ Object

primary



6
7
8
9
10
11
# File 'lib/gitarro/opt_parser.rb', line 6

def context_opt(opt)
  desc = 'Context to set on comment (test name). For example: python-test.'
  opt.on('-c', "--context 'CONTEXT'", desc) do |context|
    @options[:context] = context
  end
end

#mandatory_options(opt) ⇒ Object



25
26
27
28
29
30
# File 'lib/gitarro/opt_parser.rb', line 25

def mandatory_options(opt)
  opt.separator 'Mandatory options:'
  repo_opt(opt)
  context_opt(opt)
  test_opt(opt)
end

#repo_opt(opt) ⇒ Object



13
14
15
16
# File 'lib/gitarro/opt_parser.rb', line 13

def repo_opt(opt)
  desc = 'GitHub repository to look for PRs. For example: openSUSE/gitarro.'
  opt.on('-r', "--repo 'REPO'", desc) { |repo| @options[:repo] = repo }
end

#test_opt(opt) ⇒ Object



18
19
20
21
22
23
# File 'lib/gitarro/opt_parser.rb', line 18

def test_opt(opt)
  desc = 'Command, or full path to script/binary to be used to run the test.'
  opt.on('-t', "--test 'TEST.SH'", desc) do |test_file|
    @options[:test_file] = test_file
  end
end