Module: AIPP::AIP::Executable

Defined in:
lib/aipp/scopes/aip/executable.rb

Instance Method Summary collapse

Instance Method Details

#option_parser(o) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/aipp/scopes/aip/executable.rb', line 14

def option_parser(o)
  o.banner = <<~END
    Download online AIP and convert it to #{AIPP.options.schema.upcase}.
    Usage: #{File.basename($0)} [aip] [options]
  END
  o.on('-a', '--airac (DATE|INTEGER)', String, %Q[AIRAC date or delta e.g. "+1" (default: "#{AIPP.options.airac.date.xmlschema}")]) { AIPP.options.airac = airac_for(_1) }
  if AIPP.options.schema == :ofmx
    o.on('-g', '--[no-]grouped-obstacles', 'group obstacles (default: false)') { AIPP.options.grouped_obstacles = _1 }
  end
  o.on('-O', '--region-options STRING', String, %Q[comma separated region specific options]) { AIPP.options.region_options = _1.split(',') }
end

#optionsObject



6
7
8
9
10
11
12
# File 'lib/aipp/scopes/aip/executable.rb', line 6

def options
  AIPP.options.merge(
    scope: 'AIP',
    airac: AIRAC::Cycle.new,
    region_options: []
  )
end