From 4e2898c5656907afb7fa8c3b7d97d08b97cd36ac Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Fri, 14 Jul 2023 09:49:34 -0400 Subject: [PATCH 1/2] cmd/mr_create.go: Rearrange code Rearrange code to match that of other files. There are no functionality changes introduced in this commit. Signed-off-by: Prarit Bhargava --- cmd/mr_create.go | 140 +++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/cmd/mr_create.go b/cmd/mr_create.go index 74f71e61..918352d6 100644 --- a/cmd/mr_create.go +++ b/cmd/mr_create.go @@ -19,76 +19,6 @@ import ( lab "github.com/zaquestion/lab/internal/gitlab" ) -// mrCmd represents the mr command -var mrCreateCmd = &cobra.Command{ - Use: "create [target_remote [target_branch]]", - Aliases: []string{"new"}, - Short: "Creates a merge request.", - Args: cobra.MaximumNArgs(2), - Example: heredoc.Doc(` - lab mr create target_remote - lab mr create target_remote target_branch --allow-collaboration - lab mr create upstream main --source my_fork:feature-3 - lab mr create a_remote -a johndoe -a janedoe - lab mr create my_remote -c - lab mr create my_remote --draft - lab mr create my_remote -F a_file.txt - lab mr create my_remote -F a_file.txt --force-linebreak - lab mr create my_remote -f a_file.txt - lab mr create my_remote -l bug -l confirmed - lab mr create my_remote -m "A title message" - lab mr create my_remote -m "A MR title" -m "A MR description" - lab mr create my_remote --milestone "Fall" - lab mr create my_remote -d - lab mr create my_remote -r johndoe -r janedoe - lab mr create my_remote -s`), - PersistentPreRun: labPersistentPreRun, - Run: runMRCreate, -} - -func init() { - mrCreateCmd.Flags().StringArrayP("message", "m", []string{}, "use the given ; multiple -m are concatenated as separate paragraphs") - mrCreateCmd.Flags().StringSliceP("assignee", "a", []string{}, "set assignee by username; can be specified multiple times for multiple assignees") - mrCreateCmd.Flags().StringSliceP("reviewer", "r", []string{}, "set reviewer by username; can be specified multiple times for multiple reviewers") - mrCreateCmd.Flags().StringSliceP("label", "l", []string{}, "add label