Class: Fp::Commands::List

Inherits:
Base
  • Object
show all
Defined in:
lib/fp/commands/list.rb

Overview

fp list --project [--surface X] [--gaps] [--status draft] List requirements, optionally filtered

Constant Summary collapse

KNOWN_FLAGS =
{
  project: :string,
  surface: :string,
  status: :string,
  gaps: :boolean
}.freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Fp::Commands::Base

Instance Method Details

#run(args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fp/commands/list.rb', line 15

def run(args)
  opts, = parse_flags(args, KNOWN_FLAGS)
  require_flag(opts, :project)

  workspace_id = resolve_workspace_id(opts[:project])

  if opts[:gaps]
    list_gaps(workspace_id, opts)
  else
    list_requirements(workspace_id, opts)
  end
end