Class: ShapeupCli::Commands::Pitches

Inherits:
Base
  • Object
show all
Defined in:
lib/shapeup_cli/commands/pitches.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#agent_help?, #initialize, run

Constructor Details

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

Class Method Details

.metadataObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/shapeup_cli/commands/pitches.rb', line 6

def self.
  {
    command: "pitches",
    path: "shapeup pitches",
    short: "List and show pitches (packages)",
    subcommands: [
      { name: "list", short: "List pitches (default)", path: "shapeup pitches list" },
      { name: "show", short: "Show pitch details with scopes and tasks", path: "shapeup pitches show <id>" },
      { name: "create", short: "Create a new pitch", path: "shapeup pitches create \"Title\" --stream \"Name\"" },
      { name: "help", short: "Show usage", path: "shapeup pitches help" }
    ],
    flags: [
      { name: "status", type: "string", usage: "Filter by status: idea, framed, shaped" },
      { name: "cycle", type: "string", usage: "Filter by cycle ID" },
      { name: "limit", type: "integer", usage: "Limit number of results" },
      { name: "stream", type: "string", usage: "Stream name or ID (for create)" },
      { name: "appetite", type: "string", usage: "Appetite: unknown, small_batch, big_batch (for create, default: big_batch)" },
      { name: "cycle-id", type: "string", usage: "Assign to cycle ID (for create)" },
      { name: "no-comments", type: "bool", usage: "Hide embedded comments on show (default: show)" },
      { name: "comments-limit", type: "integer", usage: "Max comments to embed on show (default: 10, max: 50)" }
    ],
    examples: [
      "shapeup pitches list",
      "shapeup pitches list --status shaped",
      "shapeup pitches list --cycle 5",
      "shapeup pitch 42",
      "shapeup pitch 42 --json",
      "shapeup pitches create \"Redesign Search\" --stream \"Platform\"",
      "shapeup pitches create \"Auth Overhaul\" --stream \"Platform\" --appetite small_batch"
    ]
  }
end

Instance Method Details

#executeObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/shapeup_cli/commands/pitches.rb', line 39

def execute
  subcommand = positional_arg(0)

  case subcommand
  when "show"      then show
  when "create"    then create
  when "list", nil then list
  when "help"      then help
  else
    subcommand.match?(/\A\d+\z/) ? show(subcommand) : list
  end
end