From 850d18630a54b1a9daf7b7e334f5b77ab683ab96 Mon Sep 17 00:00:00 2001 From: Bruno Meneguele Date: Mon, 21 Feb 2022 16:14:22 -0300 Subject: [PATCH] mr_checkout: improve command's help message and aliases This patch adds "co" as a valid command alias and also improve the help message regarding the branch creation behavior, which follows the 'git checkout -b' behavior. Signed-off-by: Bruno Meneguele --- cmd/mr_checkout.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/mr_checkout.go b/cmd/mr_checkout.go index 2aa3d9be..fa299012 100644 --- a/cmd/mr_checkout.go +++ b/cmd/mr_checkout.go @@ -24,9 +24,14 @@ var ( // listCmd represents the list command var checkoutCmd = &cobra.Command{ - Use: "checkout [remote] []", - Short: "Checkout an open merge request", - Args: cobra.RangeArgs(1, 2), + Use: "checkout [remote] []", + Aliases: []string{"co"}, + Short: "Checkout an open merge request", + Long: heredoc.Doc(` + Checkout an open merge request using the MR's source branch name as + local branch name; this behavior can be changed using --branch + option.`), + Args: cobra.RangeArgs(1, 2), Example: heredoc.Doc(` lab mr checkout origin 10 lab mr checkout upstream -b a_branch_name