Class: ShapeupCli::Commands::Comments

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

def self.
  {
    command: "comments",
    path: "shapeup comments",
    short: "List and add comments on issues, pitches, scopes, and tasks",
    subcommands: [
      { name: "list", short: "List comments", path: "shapeup comments list --issue <id>" },
      { name: "add", short: "Add a comment", path: 'shapeup comments add --issue <id> "Comment text"' }
    ],
    flags: [
      { name: "issue", type: "string", usage: "Issue ID" },
      { name: "pitch", type: "string", usage: "Pitch ID" },
      { name: "scope", type: "string", usage: "Scope ID" },
      { name: "task", type: "string", usage: "Task ID" }
    ],
    examples: [
      "shapeup comments list --issue 42",
      'shapeup comments add --issue 42 "Investigated — this is a CSS issue in the navbar"',
      "shapeup comments list --pitch 10",
      'shapeup comments add --pitch 10 "Shaped and ready for betting"'
    ]
  }
end

Instance Method Details

#executeObject



30
31
32
33
34
35
36
37
38
# File 'lib/shapeup_cli/commands/comments.rb', line 30

def execute
  subcommand = positional_arg(0)

  case subcommand
  when "add"    then add
  when "list", nil then list
  else list
  end
end