Skip to content

Commit c1a203d

Browse files
committed
split file
1 parent b269f85 commit c1a203d

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

cli/exp_task.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cli
2+
3+
import (
4+
"github.com/coder/serpent"
5+
)
6+
7+
func (r *RootCmd) tasksCommand() *serpent.Command {
8+
cmd := &serpent.Command{
9+
Use: "task",
10+
Aliases: []string{"tasks"},
11+
Short: "Experimental task commands.",
12+
Handler: func(i *serpent.Invocation) error {
13+
return i.Command.HelpHandler(i)
14+
},
15+
Children: []*serpent.Command{
16+
r.taskList(),
17+
},
18+
}
19+
return cmd
20+
}

cli/exp_tasks.go renamed to cli/exp_tasklist.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ import (
1212
"github.com/coder/serpent"
1313
)
1414

15-
func (r *RootCmd) tasksCommand() *serpent.Command {
16-
cmd := &serpent.Command{
17-
Use: "task",
18-
Aliases: []string{"tasks"},
19-
Short: "Experimental task commands.",
20-
Handler: func(i *serpent.Invocation) error {
21-
return i.Command.HelpHandler(i)
22-
},
23-
Children: []*serpent.Command{
24-
r.tasksListCmd(),
25-
},
26-
}
27-
return cmd
28-
}
29-
3015
type taskListRow struct {
3116
Task codersdk.Task `table:"t,recursive_inline"`
3217

@@ -46,7 +31,7 @@ func taskListRowFromTask(now time.Time, t codersdk.Task) taskListRow {
4631
}
4732
}
4833

49-
func (r *RootCmd) tasksListCmd() *serpent.Command {
34+
func (r *RootCmd) taskList() *serpent.Command {
5035
var (
5136
statusFilter string
5237
all bool

0 commit comments

Comments
 (0)