Skip to content

Commit 3ee524d

Browse files
committed
use done as last column
1 parent 3c098e3 commit 3ee524d

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ git project add
5454
git project status
5555
```
5656

57-
### Cleanup all Cards in state "closed"
57+
### Cleanup all Cards in column "done"
5858
```
5959
git project clean
6060
```

commands/clean.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func cmdClean() *clif.Command {
1010
githubcommands.Cleanup(c)
1111
}
1212

13-
return clif.NewCommand("clean", "Archive all cards in the 'closed' column", cb)
13+
return clif.NewCommand("clean", "Archive all cards in the 'done' column", cb)
1414
}
1515

1616
func init() {

commands/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
func cmdStatus() *clif.Command {
99
cb := func(c *clif.Command, out clif.Output) {
10-
githubcommands.GetItems(c)
10+
githubcommands.GetItems(c, out)
1111
}
1212

1313
return clif.NewCommand("status", "List all projects and cards", cb).

common/githubcommands.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func Cleanup(c *clif.Command) {
2929

3030
cards := getCards(client, project)
3131
for _, card := range cards {
32-
if card.GetColumnName() == "closed" {
32+
if card.GetColumnName() == "done" {
3333
fmt.Println("Archived", card.GetNote(), "in", project.GetName())
3434
archived := true
3535
client.Projects.UpdateProjectCard(ctx, card.GetID(), &github.ProjectCardOptions{Archived: &archived})
@@ -77,7 +77,7 @@ func CreateRepoProject(c *clif.Command, in clif.Input, repo *git.Repository) {
7777
project, _, projectErr := client.Repositories.CreateProject(ctx, repositorydetails.owner, repositorydetails.name, &github.ProjectOptions{Name: &name, Body: &body, Public: &public})
7878
if projectErr == nil {
7979
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "open"})
80-
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "closed"})
80+
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "done"})
8181
}
8282
}
8383

@@ -103,20 +103,20 @@ func CreatePersonalProject(c *clif.Command, in clif.Input) {
103103
}
104104
client.Projects.UpdateProject(ctx, project.GetID(), &github.ProjectOptions{Body: &body, Public: &public})
105105
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "open"})
106-
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "closed"})
106+
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "done"})
107107
}
108108

109109
}
110110

111-
func GetItems(c *clif.Command) {
111+
func GetItems(c *clif.Command, out clif.Output) {
112112
client := login(c)
113113

114114
for _, project := range getProjects(client) {
115-
fmt.Println("\n\nList: ", project.GetName(), "("+project.GetState()+")")
116-
fmt.Println("--------------------------------------")
115+
out.Printf("\n\n<subline>List: " + project.GetName() + "<reset>\n")
117116
cards := getCards(client, project)
118117
for _, card := range cards {
119-
fmt.Println(" <"+card.GetColumnName()+">", " ", card.GetNote())
118+
//fmt.Println(" <"+card.GetColumnName()+">", " ", card.GetNote())
119+
out.Printf(" <" + card.GetColumnName() + "> " + card.GetNote() + "\n")
120120
}
121121
}
122122
}

main/main.go

+14-11
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ func main() {
1717
cli := clif.New("git-project", "DEV-VERSION", "Manage your github projects with git cli")
1818

1919
var OwnStyles = map[string]string{
20-
"error": "\033[31;1m",
21-
"warn": "\033[33m",
22-
"info": "\033[0;97m",
23-
"success": "\033[32m",
24-
"debug": "\033[30;1m",
25-
"headline": "\033[4;1m",
26-
"subline": "\033[4m",
27-
"important": "\033[47;30;1m",
28-
"query": "\033[36m",
29-
"reset": "\033[0m",
20+
"error": "\033[31;1m",
21+
"warn": "\033[33m",
22+
"info": "\033[0;97m",
23+
"success": "\033[32m",
24+
"debug": "\033[30;1m",
25+
"headline": "\033[4;1m",
26+
"subline": "\033[4m",
27+
"important": "\033[47;30;1m",
28+
"query": "\033[36m",
29+
"reset": "\033[0m",
30+
"open": "\U00002B50",
31+
"done": "\U00002705",
32+
"in progress": "\U0001F528",
3033
}
3134

3235
cli.SetOutput(clif.NewColorOutput(os.Stdout).SetFormatter(clif.NewDefaultFormatter(OwnStyles)))
@@ -49,7 +52,7 @@ U:Usage:R:
4952
5053
U:Available commands:R:
5154
I:add R: Add a new card
52-
I:clean R: Archive all cards in the 'closed' column
55+
I:clean R: Archive all cards in the 'done' column
5356
I:close R: Close a project
5457
I:createR: Create a new project
5558
I:help R: Show this help

0 commit comments

Comments
 (0)