mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 15:32:53 +00:00
added doing
initial version with completions missing
This commit is contained in:
parent
b4dc9ba8ec
commit
bb0f260e02
21
completers/doing_completer/cmd/init.go
Normal file
21
completers/doing_completer/cmd/init.go
Normal file
@ -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
completers/doing_completer/cmd/issue.go
Normal file
19
completers/doing_completer/cmd/issue.go
Normal file
@ -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
completers/doing_completer/cmd/issue_close.go
Normal file
21
completers/doing_completer/cmd/issue_close.go
Normal file
@ -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
completers/doing_completer/cmd/issue_create.go
Normal file
42
completers/doing_completer/cmd/issue_create.go
Normal file
@ -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
completers/doing_completer/cmd/issue_list.go
Normal file
43
completers/doing_completer/cmd/issue_list.go
Normal file
@ -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
completers/doing_completer/cmd/list.go
Normal file
39
completers/doing_completer/cmd/list.go
Normal file
@ -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
completers/doing_completer/cmd/open.go
Normal file
19
completers/doing_completer/cmd/open.go
Normal file
@ -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
completers/doing_completer/cmd/open_board.go
Normal file
19
completers/doing_completer/cmd/open_board.go
Normal file
@ -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
completers/doing_completer/cmd/open_branch.go
Normal file
19
completers/doing_completer/cmd/open_branch.go
Normal file
@ -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
completers/doing_completer/cmd/open_branches.go
Normal file
19
completers/doing_completer/cmd/open_branches.go
Normal file
@ -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
completers/doing_completer/cmd/open_issue.go
Normal file
19
completers/doing_completer/cmd/open_issue.go
Normal file
@ -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
completers/doing_completer/cmd/open_issues.go
Normal file
19
completers/doing_completer/cmd/open_issues.go
Normal file
@ -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
completers/doing_completer/cmd/open_pipe.go
Normal file
19
completers/doing_completer/cmd/open_pipe.go
Normal file
@ -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
completers/doing_completer/cmd/open_policies.go
Normal file
19
completers/doing_completer/cmd/open_policies.go
Normal file
@ -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
completers/doing_completer/cmd/open_pr.go
Normal file
19
completers/doing_completer/cmd/open_pr.go
Normal file
@ -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
completers/doing_completer/cmd/open_prs.go
Normal file
19
completers/doing_completer/cmd/open_prs.go
Normal file
@ -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)
|
||||
}
|
19
completers/doing_completer/cmd/open_repo.go
Normal file
19
completers/doing_completer/cmd/open_repo.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var open_repoCmd = &cobra.Command{
|
||||
Use: "repo",
|
||||
Short: "Open repository view",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(open_repoCmd).Standalone()
|
||||
|
||||
open_repoCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
openCmd.AddCommand(open_repoCmd)
|
||||
}
|
19
completers/doing_completer/cmd/open_sprint.go
Normal file
19
completers/doing_completer/cmd/open_sprint.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var open_sprintCmd = &cobra.Command{
|
||||
Use: "sprint",
|
||||
Short: "Open current sprint view",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(open_sprintCmd).Standalone()
|
||||
|
||||
open_sprintCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
openCmd.AddCommand(open_sprintCmd)
|
||||
}
|
19
completers/doing_completer/cmd/pr.go
Normal file
19
completers/doing_completer/cmd/pr.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var prCmd = &cobra.Command{
|
||||
Use: "pr [OPTIONS] COMMAND [ARGS]...",
|
||||
Short: "Work with pull requests",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(prCmd).Standalone()
|
||||
|
||||
prCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
rootCmd.AddCommand(prCmd)
|
||||
}
|
19
completers/doing_completer/cmd/pr_checkout.go
Normal file
19
completers/doing_completer/cmd/pr_checkout.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var pr_checkoutCmd = &cobra.Command{
|
||||
Use: "checkout [OPTIONS] PR_ID",
|
||||
Short: "Check out a pull request in git",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(pr_checkoutCmd).Standalone()
|
||||
|
||||
pr_checkoutCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
prCmd.AddCommand(pr_checkoutCmd)
|
||||
}
|
19
completers/doing_completer/cmd/pr_close.go
Normal file
19
completers/doing_completer/cmd/pr_close.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var pr_closeCmd = &cobra.Command{
|
||||
Use: "close [OPTIONS] PR_ID...",
|
||||
Short: "Close a specific PR_ID",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(pr_closeCmd).Standalone()
|
||||
|
||||
pr_closeCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
prCmd.AddCommand(pr_closeCmd)
|
||||
}
|
43
completers/doing_completer/cmd/pr_create.go
Normal file
43
completers/doing_completer/cmd/pr_create.go
Normal file
@ -0,0 +1,43 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var pr_createCmd = &cobra.Command{
|
||||
Use: "create [OPTIONS] WORK_ITEM_ID",
|
||||
Short: "Create a pull request from a work item ID",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(pr_createCmd).Standalone()
|
||||
|
||||
pr_createCmd.Flags().Bool("auto-complete", false, "Set the PR to complete autom. when all policies have passed")
|
||||
pr_createCmd.Flags().String("branch-prefix", "", "The prefix to be prepended to the branch name")
|
||||
pr_createCmd.Flags().Bool("checkout", false, "Run git commands to checkout remote branch locally")
|
||||
pr_createCmd.Flags().StringP("default-branch", "b", "", "The name of the branch to branch from and to")
|
||||
pr_createCmd.Flags().Bool("delete-source-branch", false, "Set to delete source branch when pull request completes")
|
||||
pr_createCmd.Flags().Bool("draft", false, "Create draft/WIP pull request")
|
||||
pr_createCmd.Flags().Bool("help", false, "Show this message and exit")
|
||||
pr_createCmd.Flags().Bool("no-auto-complete", false, "Set the PR to complete autom. when all policies have passed")
|
||||
pr_createCmd.Flags().Bool("no-checkout", false, "Do not run git commands to checkout remote branch locally")
|
||||
pr_createCmd.Flags().Bool("no-delete-source-branch", false, "Set to delete source branch when pull request completes")
|
||||
pr_createCmd.Flags().Bool("no-draft", false, "Do not create draft/WIP pull request")
|
||||
pr_createCmd.Flags().Bool("no-self-approve", false, "Do not add yourself as reviewer and add your approval")
|
||||
pr_createCmd.Flags().Bool("no-web", false, "Open newly created issue in the web browser")
|
||||
pr_createCmd.Flags().StringP("reviewers", "r", "", "Space separated list of reviewer emails or aliases")
|
||||
pr_createCmd.Flags().Bool("self-approve", false, "Add yourself as reviewer and add your approval")
|
||||
pr_createCmd.Flags().BoolP("web", "w", false, "Open newly created issue in the web browser")
|
||||
prCmd.AddCommand(pr_createCmd)
|
||||
|
||||
carapace.Gen(pr_createCmd).FlagCompletion(carapace.ActionMap{
|
||||
"branch-prefix": carapace.ActionValues(),
|
||||
"default-branch": git.ActionRefs(git.RefOption{LocalBranches: true, RemoteBranches: true}), // TODO test
|
||||
"reviewers": carapace.ActionValues(),
|
||||
})
|
||||
|
||||
// TODO positional completion
|
||||
}
|
33
completers/doing_completer/cmd/pr_list.go
Normal file
33
completers/doing_completer/cmd/pr_list.go
Normal file
@ -0,0 +1,33 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var pr_listCmd = &cobra.Command{
|
||||
Use: "list [OPTIONS]",
|
||||
Short: "List pull requests related to the project",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(pr_listCmd).Standalone()
|
||||
|
||||
pr_listCmd.Flags().StringP("assignee", "a", "", "Filter by assigned reviewers")
|
||||
pr_listCmd.Flags().Bool("help", false, "Show this message and exit")
|
||||
pr_listCmd.Flags().StringP("label", "l", "", "Filter by labels")
|
||||
pr_listCmd.Flags().StringP("limit", "L", "", "Maximum number of items to fetch")
|
||||
pr_listCmd.Flags().Bool("no-web", false, "Open overview of issues in the web browser")
|
||||
pr_listCmd.Flags().StringP("state", "s", "", "Filter by state")
|
||||
pr_listCmd.Flags().BoolP("web", "w", false, "Open overview of issues in the web browser")
|
||||
prCmd.AddCommand(pr_listCmd)
|
||||
|
||||
// TODO flag completion
|
||||
carapace.Gen(pr_listCmd).FlagCompletion(carapace.ActionMap{
|
||||
"assignee": carapace.ActionValues(),
|
||||
"label": carapace.ActionValues(),
|
||||
"limit": carapace.ActionValues(),
|
||||
"state": carapace.ActionValues("open", "closed", "merged", "all"),
|
||||
})
|
||||
}
|
19
completers/doing_completer/cmd/pr_open.go
Normal file
19
completers/doing_completer/cmd/pr_open.go
Normal file
@ -0,0 +1,19 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var pr_openCmd = &cobra.Command{
|
||||
Use: "open [OPTIONS] [PULLREQUEST_ID]",
|
||||
Short: "Alias: `doing open pr`",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(pr_openCmd).Standalone()
|
||||
|
||||
pr_openCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
prCmd.AddCommand(pr_openCmd)
|
||||
}
|
23
completers/doing_completer/cmd/root.go
Normal file
23
completers/doing_completer/cmd/root.go
Normal file
@ -0,0 +1,23 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "doing [OPTIONS] COMMAND [ARGS]...",
|
||||
Short: "CLI for repository/issue workflow on Azure Devops",
|
||||
Long: "https://github.com/ing-bank/doing-cli",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
func init() {
|
||||
carapace.Gen(rootCmd).Standalone()
|
||||
|
||||
rootCmd.Flags().Bool("help", false, "Show this message and exit.")
|
||||
rootCmd.Flags().Bool("version", false, "Show the version and exit.")
|
||||
}
|
51
completers/doing_completer/cmd/workon.go
Normal file
51
completers/doing_completer/cmd/workon.go
Normal file
@ -0,0 +1,51 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/doing"
|
||||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var workonCmd = &cobra.Command{
|
||||
Use: "workon [OPTIONS] ISSUE",
|
||||
Short: "Create issue with PR and switch git branch",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(workonCmd).Standalone()
|
||||
|
||||
workonCmd.Flags().Bool("add-to-current-sprint", false, "Add item to the current sprint")
|
||||
workonCmd.Flags().Bool("auto-complete", false, "Set the PR to complete autom. when all policies have passed")
|
||||
workonCmd.Flags().String("branch-prefix", "", "The prefix to be prepended to the branch name")
|
||||
workonCmd.Flags().Bool("checkout", false, "Run git commands to checkout remote branch locally")
|
||||
workonCmd.Flags().StringP("default-branch", "b", "", "The name of the branch to branch from and to")
|
||||
workonCmd.Flags().Bool("delete-source-branch", false, "Set to delete source branch when pull request completes")
|
||||
workonCmd.Flags().Bool("do-not-add-to-current-sprint", false, "Do not add item to the current sprint")
|
||||
workonCmd.Flags().Bool("draft", false, "Create draft/WIP pull request")
|
||||
workonCmd.Flags().Bool("help", false, "Show this message and exit")
|
||||
workonCmd.Flags().StringP("label", "l", "", "Attach tags (labels) to work item")
|
||||
workonCmd.Flags().Bool("no-auto-complete", false, "Do not set the PR to complete autom. when all policies have passed")
|
||||
workonCmd.Flags().Bool("no-checkout", false, "Do not run git commands to checkout remote branch locally")
|
||||
workonCmd.Flags().Bool("no-delete-source-branch", false, "Set to delete source branch when pull request completes")
|
||||
workonCmd.Flags().Bool("no-draft", false, "Do not create draft/WIP pull request")
|
||||
workonCmd.Flags().Bool("no-self-approve", false, "Do not add yourself as reviewer and add your approval")
|
||||
workonCmd.Flags().StringP("parent", "p", "", "To create a child work item, specify the ID of the parent work item")
|
||||
workonCmd.Flags().StringP("reviewers", "r", "", "Space separated list of reviewer emails")
|
||||
workonCmd.Flags().Bool("self-approve", false, "Add yourself as reviewer and add your approval")
|
||||
workonCmd.Flags().StringP("story-points", "s", "", "The number of story points to assign")
|
||||
workonCmd.Flags().String("type", "", "Type of work item")
|
||||
rootCmd.AddCommand(workonCmd)
|
||||
|
||||
carapace.Gen(workonCmd).FlagCompletion(carapace.ActionMap{
|
||||
"default-branch": git.ActionRefs(git.RefOption{LocalBranches: true, RemoteBranches: true}), // TODO test
|
||||
"label": carapace.ActionValues(), // TODO
|
||||
"parent": carapace.ActionValues(), // TODO
|
||||
"reviewers": carapace.ActionValues(), // TODO
|
||||
"story-points": carapace.ActionValues(), // TODO
|
||||
"type": doing.ActionWorkItemTypes(),
|
||||
})
|
||||
|
||||
// TODO positional completion
|
||||
}
|
7
completers/doing_completer/main.go
Normal file
7
completers/doing_completer/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/doing_completer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
16
pkg/actions/tools/doing/workitem.go
Normal file
16
pkg/actions/tools/doing/workitem.go
Normal file
@ -0,0 +1,16 @@
|
||||
package doing
|
||||
|
||||
import "github.com/carapace-sh/carapace"
|
||||
|
||||
// ActionWorkItemTypes completes work item types
|
||||
func ActionWorkItemTypes() carapace.Action {
|
||||
return carapace.ActionValues(
|
||||
"Bug",
|
||||
"Epic",
|
||||
"Feature",
|
||||
"Issue",
|
||||
"Task",
|
||||
"Test Case",
|
||||
"User Story",
|
||||
)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user