Method: Glb::Lb::Args#allowed_options

Defined in:
lib/glb/lb/args.rb

#allowed_options(command) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/glb/lb/args.rb', line 38

def allowed_options(command)
  lines = capture("gcloud help compute #{command}", show_command: false).split("\n")
  lines = lines.grep(/--/)
  lines = filter_special_cases(lines)
  lines.map do |line|
    md = line.match(/--([\w-]+)/)
    md[1] if md
  end.compact.sort.uniq
end