Class: ShapeupCli::Commands::Scopes

Inherits:
Base
  • Object
show all
Defined in:
lib/shapeup_cli/commands/scopes.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
# File 'lib/shapeup_cli/commands/scopes.rb', line 6

def self.
  {
    command: "scopes",
    path: "shapeup scopes",
    short: "Manage scopes within a pitch",
    subcommands: [
      { name: "list", short: "List scopes for a pitch", path: "shapeup scopes list --pitch <id>" },
      { name: "create", short: "Create a new scope", path: "shapeup scopes create --pitch <id> \"Title\"" },
      { name: "update", short: "Update scope title or color", path: "shapeup scopes update <id> --title \"New\"" },
      { name: "position", short: "Update hill chart position (0-100)", path: "shapeup scopes position <id> <position>" }
    ],
    flags: [
      { name: "pitch", type: "string", usage: "Pitch ID (required for list and create)" },
      { name: "title", type: "string", usage: "Scope title (for create/update)" },
      { name: "color", type: "string", usage: "Hex color code (for update)" }
    ],
    examples: [
      "shapeup scopes list --pitch 42",
      "shapeup scopes create --pitch 42 \"User onboarding\"",
      "shapeup scopes update 7 --title \"Revised onboarding\"",
      "shapeup scopes position 7 50"
    ]
  }
end

Instance Method Details

#executeObject



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/shapeup_cli/commands/scopes.rb', line 31

def execute
  subcommand = positional_arg(0)

  case subcommand
  when "create"   then create
  when "update"   then update
  when "position" then position
  when "list", nil then list
  else list
  end
end