Class: ShapeupCli::Commands::Tasks

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

def self.
  {
    command: "tasks",
    path: "shapeup tasks",
    short: "Manage tasks within scopes and pitches",
    aliases: { "todo" => "tasks create", "done" => "tasks complete" },
    subcommands: [
      { name: "list", short: "List tasks", path: "shapeup tasks list" },
      { name: "create", short: "Create a task", path: "shapeup todo \"Description\" --pitch <id>" },
      { name: "complete", short: "Mark task(s) as complete", path: "shapeup done <id> [<id>...]" }
    ],
    flags: [
      { name: "pitch", type: "string", usage: "Pitch ID (required for create)" },
      { name: "scope", type: "string", usage: "Scope ID (optional filter or target)" },
      { name: "assignee", type: "string", usage: "User ID or 'me' (for list)" }
    ],
    examples: [
      "shapeup tasks list --pitch 42",
      "shapeup tasks list --assignee me",
      "shapeup todo \"Fix login bug\" --pitch 42 --scope 7",
      "shapeup done 123",
      "shapeup done 123 124 125"
    ]
  }
end

Instance Method Details

#executeObject



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

def execute
  subcommand = positional_arg(0)

  case subcommand
  when "create"   then create
  when "complete" then complete
  when "list", nil then list
  else list
  end
end