Skip to content

Commit

Permalink
mr_checkout: improve command's help message and aliases
Browse files Browse the repository at this point in the history
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 <bmeneg@redhat.com>
  • Loading branch information
bmeneg committed Feb 22, 2022
1 parent 2ba2e55 commit 850d186
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/mr_checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ var (

// listCmd represents the list command
var checkoutCmd = &cobra.Command{
Use: "checkout [remote] [<MR id or branch>]",
Short: "Checkout an open merge request",
Args: cobra.RangeArgs(1, 2),
Use: "checkout [remote] [<MR id or branch>]",
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
Expand Down

0 comments on commit 850d186

Please sign in to comment.