Skip to content

Commit

Permalink
Merge pull request #2340 from carapace-sh/add-doing
Browse files Browse the repository at this point in the history
added doing
  • Loading branch information
rsteube authored Apr 14, 2024
2 parents b4dc9ba + bb0f260 commit 1af881e
Show file tree
Hide file tree
Showing 28 changed files with 662 additions and 0 deletions.
21 changes: 21 additions & 0 deletions completers/doing_completer/cmd/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var initCmd = &cobra.Command{
Use: "doing init [OPTIONS] [REFERENCE_ISSUE]",
Short: "Create a .doing-cli-config file",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(initCmd).Standalone()

initCmd.Flags().Bool("help", false, "Show this message and exit.")
rootCmd.AddCommand(initCmd)

// TODO positional completion
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/issue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var issueCmd = &cobra.Command{
Use: "issue [OPTIONS] COMMAND [ARGS]...",
Short: "Work with issues",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(issueCmd).Standalone()

issueCmd.Flags().Bool("help", false, "Show this message and exit.")
rootCmd.AddCommand(issueCmd)
}
21 changes: 21 additions & 0 deletions completers/doing_completer/cmd/issue_close.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var issue_closeCmd = &cobra.Command{
Use: "close [OPTIONS] WORK_ITEM_ID...",
Short: "Close a specific WORK_ITEM_ID",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(issue_closeCmd).Standalone()

issue_closeCmd.Flags().Bool("help", false, "Show this message and exit.")
issueCmd.AddCommand(issue_closeCmd)

// TODO positional completion
}
42 changes: 42 additions & 0 deletions completers/doing_completer/cmd/issue_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
"github.com/spf13/cobra"
)

var issue_createCmd = &cobra.Command{
Use: "create [OPTIONS] ISSUE",
Short: "Create an issue",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(issue_createCmd).Standalone()

issue_createCmd.Flags().Bool("add-to-current-sprint", false, "If the item needs to be added to the current sprint")
issue_createCmd.Flags().StringP("assignee", "a", "", "Emailadres or alias of person to assign")
issue_createCmd.Flags().StringP("body", "b", "", "Optional description of the work item")
issue_createCmd.Flags().Bool("do-not-add-to-current-sprint", false, "If the item needs to be added to the current sprint")
issue_createCmd.Flags().Bool("help", false, "Show this message and exit")
issue_createCmd.Flags().StringP("label", "l", "", "Attach tags (labels) to work item")
issue_createCmd.Flags().BoolP("mine", "m", false, "Assign issue to yourself")
issue_createCmd.Flags().Bool("not-mine", false, "Do not assign issue to yourself")
issue_createCmd.Flags().StringP("parent", "p", "", "To create a child work item, specify the ID of the parent work item")
issue_createCmd.Flags().StringP("story_points", "s", "", "The number of story points to assign assigned if not specified")
issue_createCmd.Flags().StringP("type", "t", "", "Type of work item")
issueCmd.AddCommand(issue_createCmd)

// TODO completion
carapace.Gen(issue_createCmd).FlagCompletion(carapace.ActionMap{
"assignee": carapace.ActionValues("@me"),
"body": carapace.ActionValues(),
"label": carapace.ActionValues(),
"parent": carapace.ActionValues(),
"story_points": carapace.ActionValues(),
"type": doing.ActionWorkItemTypes(),
})

// TODO positional completion
}
43 changes: 43 additions & 0 deletions completers/doing_completer/cmd/issue_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
"github.com/spf13/cobra"
)

var issue_listCmd = &cobra.Command{
Use: "list [OPTIONS]",
Short: "List issues related to the project",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(issue_listCmd).Standalone()

issue_listCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
issue_listCmd.Flags().StringP("author", "A", "", "Filter by author")
issue_listCmd.Flags().Bool("help", false, "Show this message and exit")
issue_listCmd.Flags().StringP("label", "l", "", "Filter by labels")
issue_listCmd.Flags().Bool("no-show_state", false, "Do not show column with work item state")
issue_listCmd.Flags().Bool("no-web", false, "Open overview of issues in the web browser")
issue_listCmd.Flags().StringP("output_format", "o", "", "Output format")
issue_listCmd.Flags().Bool("show_state", false, "Show column with work item state")
issue_listCmd.Flags().StringP("state", "s", "", "Filter by state")
issue_listCmd.Flags().String("story_points", "", "Filter on number of story points")
issue_listCmd.Flags().StringP("type", "t", "", "Type of work item")
issue_listCmd.Flags().BoolP("web", "w", false, "Open overview of issues in the web browser")
issueCmd.AddCommand(issue_listCmd)

// TODO completion
carapace.Gen(issue_listCmd).FlagCompletion(carapace.ActionMap{
"assignee": carapace.ActionValues(),
"author": carapace.ActionValues(),
"label": carapace.ActionValues(),
"output_format": carapace.ActionValues("table", "array"),
"state": carapace.ActionValues(),
"story_points": carapace.ActionValues(),
"type": doing.ActionWorkItemTypes(),
})

}
39 changes: 39 additions & 0 deletions completers/doing_completer/cmd/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)

var listCmd = &cobra.Command{
Use: "list [OPTIONS]",
Short: "List issues related to the project",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(listCmd).Standalone()

listCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
listCmd.Flags().StringP("author", "A", "", "Filter by author")
listCmd.Flags().Bool("help", false, "Show this message and exit")
listCmd.Flags().StringP("label", "l", "", "Filter by labels")
listCmd.Flags().StringP("output_format", "o", "", "Output format")
listCmd.Flags().StringP("state", "s", "", "Filter by state")
listCmd.Flags().String("story_points", "", "Filter on number of story points")
listCmd.Flags().StringP("type", "t", "", "Type of work item")
rootCmd.AddCommand(listCmd)

// TODO completion
carapace.Gen(listCmd).FlagCompletion(carapace.ActionMap{
"assignee": carapace.ActionValues(),
"author": carapace.ActionValues(),
"label": carapace.ActionValues(),
"output_format": carapace.ActionValues("table", "array"),
"state": carapace.ActionValues("open", "closed", "all").StyleF(style.ForKeyword), // TODO custom states
"story_points": carapace.ActionValues(),
"type": doing.ActionWorkItemTypes(),
})
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var openCmd = &cobra.Command{
Use: "open [OPTIONS] COMMAND [ARGS]...",
Short: "Quickly open certain links",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(openCmd).Standalone()

openCmd.Flags().Bool("help", false, "Show this message and exit.")
rootCmd.AddCommand(openCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_board.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_boardCmd = &cobra.Command{
Use: "board",
Short: "Open board view",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_boardCmd).Standalone()

open_boardCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_boardCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_branch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_branchCmd = &cobra.Command{
Use: "branch",
Short: "Open a specific BRANCH_NAME",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_branchCmd).Standalone()

open_branchCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_branchCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_branches.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_branchesCmd = &cobra.Command{
Use: "branches",
Short: "Open an overview of the repositories' branches",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_branchesCmd).Standalone()

open_branchesCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_branchesCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_issue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_issueCmd = &cobra.Command{
Use: "issue",
Short: "Open a specific WORK_ITEM_ID",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_issueCmd).Standalone()

open_issueCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_issueCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_issues.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_issuesCmd = &cobra.Command{
Use: "issues",
Short: "Open all active issues view",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_issuesCmd).Standalone()

open_issuesCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_issuesCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_pipe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_pipeCmd = &cobra.Command{
Use: "pipe",
Short: "Open latest pipeline runs for repository view",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_pipeCmd).Standalone()

open_pipeCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_pipeCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_policies.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_policiesCmd = &cobra.Command{
Use: "policies",
Short: "Will show the default branch policies by default",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_policiesCmd).Standalone()

open_policiesCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_policiesCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_pr.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_prCmd = &cobra.Command{
Use: "pr",
Short: "Open a specific PULLREQUEST_ID",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_prCmd).Standalone()

open_prCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_prCmd)
}
19 changes: 19 additions & 0 deletions completers/doing_completer/cmd/open_prs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var open_prsCmd = &cobra.Command{
Use: "prs",
Short: "Open active PRs for repository view",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(open_prsCmd).Standalone()

open_prsCmd.Flags().Bool("help", false, "Show this message and exit.")
openCmd.AddCommand(open_prsCmd)
}
Loading

0 comments on commit 1af881e

Please sign in to comment.