Skip to content

Commit 1af881e

Browse files
authored
Merge pull request #2340 from carapace-sh/add-doing
added doing
2 parents b4dc9ba + bb0f260 commit 1af881e

28 files changed

+662
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var initCmd = &cobra.Command{
9+
Use: "doing init [OPTIONS] [REFERENCE_ISSUE]",
10+
Short: "Create a .doing-cli-config file",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(initCmd).Standalone()
16+
17+
initCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
rootCmd.AddCommand(initCmd)
19+
20+
// TODO positional completion
21+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var issueCmd = &cobra.Command{
9+
Use: "issue [OPTIONS] COMMAND [ARGS]...",
10+
Short: "Work with issues",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(issueCmd).Standalone()
16+
17+
issueCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
rootCmd.AddCommand(issueCmd)
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var issue_closeCmd = &cobra.Command{
9+
Use: "close [OPTIONS] WORK_ITEM_ID...",
10+
Short: "Close a specific WORK_ITEM_ID",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(issue_closeCmd).Standalone()
16+
17+
issue_closeCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
issueCmd.AddCommand(issue_closeCmd)
19+
20+
// TODO positional completion
21+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var issue_createCmd = &cobra.Command{
10+
Use: "create [OPTIONS] ISSUE",
11+
Short: "Create an issue",
12+
Run: func(cmd *cobra.Command, args []string) {},
13+
}
14+
15+
func init() {
16+
carapace.Gen(issue_createCmd).Standalone()
17+
18+
issue_createCmd.Flags().Bool("add-to-current-sprint", false, "If the item needs to be added to the current sprint")
19+
issue_createCmd.Flags().StringP("assignee", "a", "", "Emailadres or alias of person to assign")
20+
issue_createCmd.Flags().StringP("body", "b", "", "Optional description of the work item")
21+
issue_createCmd.Flags().Bool("do-not-add-to-current-sprint", false, "If the item needs to be added to the current sprint")
22+
issue_createCmd.Flags().Bool("help", false, "Show this message and exit")
23+
issue_createCmd.Flags().StringP("label", "l", "", "Attach tags (labels) to work item")
24+
issue_createCmd.Flags().BoolP("mine", "m", false, "Assign issue to yourself")
25+
issue_createCmd.Flags().Bool("not-mine", false, "Do not assign issue to yourself")
26+
issue_createCmd.Flags().StringP("parent", "p", "", "To create a child work item, specify the ID of the parent work item")
27+
issue_createCmd.Flags().StringP("story_points", "s", "", "The number of story points to assign assigned if not specified")
28+
issue_createCmd.Flags().StringP("type", "t", "", "Type of work item")
29+
issueCmd.AddCommand(issue_createCmd)
30+
31+
// TODO completion
32+
carapace.Gen(issue_createCmd).FlagCompletion(carapace.ActionMap{
33+
"assignee": carapace.ActionValues("@me"),
34+
"body": carapace.ActionValues(),
35+
"label": carapace.ActionValues(),
36+
"parent": carapace.ActionValues(),
37+
"story_points": carapace.ActionValues(),
38+
"type": doing.ActionWorkItemTypes(),
39+
})
40+
41+
// TODO positional completion
42+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
6+
"github.com/spf13/cobra"
7+
)
8+
9+
var issue_listCmd = &cobra.Command{
10+
Use: "list [OPTIONS]",
11+
Short: "List issues related to the project",
12+
Run: func(cmd *cobra.Command, args []string) {},
13+
}
14+
15+
func init() {
16+
carapace.Gen(issue_listCmd).Standalone()
17+
18+
issue_listCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
19+
issue_listCmd.Flags().StringP("author", "A", "", "Filter by author")
20+
issue_listCmd.Flags().Bool("help", false, "Show this message and exit")
21+
issue_listCmd.Flags().StringP("label", "l", "", "Filter by labels")
22+
issue_listCmd.Flags().Bool("no-show_state", false, "Do not show column with work item state")
23+
issue_listCmd.Flags().Bool("no-web", false, "Open overview of issues in the web browser")
24+
issue_listCmd.Flags().StringP("output_format", "o", "", "Output format")
25+
issue_listCmd.Flags().Bool("show_state", false, "Show column with work item state")
26+
issue_listCmd.Flags().StringP("state", "s", "", "Filter by state")
27+
issue_listCmd.Flags().String("story_points", "", "Filter on number of story points")
28+
issue_listCmd.Flags().StringP("type", "t", "", "Type of work item")
29+
issue_listCmd.Flags().BoolP("web", "w", false, "Open overview of issues in the web browser")
30+
issueCmd.AddCommand(issue_listCmd)
31+
32+
// TODO completion
33+
carapace.Gen(issue_listCmd).FlagCompletion(carapace.ActionMap{
34+
"assignee": carapace.ActionValues(),
35+
"author": carapace.ActionValues(),
36+
"label": carapace.ActionValues(),
37+
"output_format": carapace.ActionValues("table", "array"),
38+
"state": carapace.ActionValues(),
39+
"story_points": carapace.ActionValues(),
40+
"type": doing.ActionWorkItemTypes(),
41+
})
42+
43+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
6+
"github.com/carapace-sh/carapace/pkg/style"
7+
"github.com/spf13/cobra"
8+
)
9+
10+
var listCmd = &cobra.Command{
11+
Use: "list [OPTIONS]",
12+
Short: "List issues related to the project",
13+
Run: func(cmd *cobra.Command, args []string) {},
14+
}
15+
16+
func init() {
17+
carapace.Gen(listCmd).Standalone()
18+
19+
listCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
20+
listCmd.Flags().StringP("author", "A", "", "Filter by author")
21+
listCmd.Flags().Bool("help", false, "Show this message and exit")
22+
listCmd.Flags().StringP("label", "l", "", "Filter by labels")
23+
listCmd.Flags().StringP("output_format", "o", "", "Output format")
24+
listCmd.Flags().StringP("state", "s", "", "Filter by state")
25+
listCmd.Flags().String("story_points", "", "Filter on number of story points")
26+
listCmd.Flags().StringP("type", "t", "", "Type of work item")
27+
rootCmd.AddCommand(listCmd)
28+
29+
// TODO completion
30+
carapace.Gen(listCmd).FlagCompletion(carapace.ActionMap{
31+
"assignee": carapace.ActionValues(),
32+
"author": carapace.ActionValues(),
33+
"label": carapace.ActionValues(),
34+
"output_format": carapace.ActionValues("table", "array"),
35+
"state": carapace.ActionValues("open", "closed", "all").StyleF(style.ForKeyword), // TODO custom states
36+
"story_points": carapace.ActionValues(),
37+
"type": doing.ActionWorkItemTypes(),
38+
})
39+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var openCmd = &cobra.Command{
9+
Use: "open [OPTIONS] COMMAND [ARGS]...",
10+
Short: "Quickly open certain links",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(openCmd).Standalone()
16+
17+
openCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
rootCmd.AddCommand(openCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var open_boardCmd = &cobra.Command{
9+
Use: "board",
10+
Short: "Open board view",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(open_boardCmd).Standalone()
16+
17+
open_boardCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
openCmd.AddCommand(open_boardCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var open_branchCmd = &cobra.Command{
9+
Use: "branch",
10+
Short: "Open a specific BRANCH_NAME",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(open_branchCmd).Standalone()
16+
17+
open_branchCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
openCmd.AddCommand(open_branchCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var open_branchesCmd = &cobra.Command{
9+
Use: "branches",
10+
Short: "Open an overview of the repositories' branches",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(open_branchesCmd).Standalone()
16+
17+
open_branchesCmd.Flags().Bool("help", false, "Show this message and exit.")
18+
openCmd.AddCommand(open_branchesCmd)
19+
}

0 commit comments

Comments
 (0)