<commit_before>package cmd

import (
	"fmt"

	"github.com/MakeNowJust/heredoc/v2"
	"github.com/rsteube/carapace"
	"github.com/spf13/cobra"
	"github.com/zaquestion/lab/internal/action"
	"github.com/zaquestion/lab/internal/git"
	lab "github.com/zaquestion/lab/internal/gitlab"
)

// mrCheckoutConfig holds configuration values for calls to lab mr checkout
type mrCheckoutConfig struct {
	branch string
	force  bool
	track  bool
}

var (
	mrCheckoutCfg mrCheckoutConfig
)

// 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),
	Example: heredoc.Doc(`
		lab mr checkout origin 10
		lab mr checkout upstream -b a_branch_name
		lab mr checkout a_remote -f
		lab mr checkout upstream --https
		lab mr checkout upstream -t`),
	PersistentPreRun: labPersistentPreRun,
	Run: func(cmd *cobra.Command, args []string) {
		rn, mrID, err := parseArgsRemoteAndID(args)
		if err != nil {
			log.Fatal(err)
		}

		targetRemote := defaultRemote
		if len(args) == 2 {<commit_msg>mr_checkout: improve command's help message and aliases<commit_after>package cmd

import (
	"fmt"

	"github.com/MakeNowJust/heredoc/v2"
	"github.com/rsteube/carapace"
	"github.com/spf13/cobra"
	"github.com/zaquestion/lab/internal/action"
	"github.com/zaquestion/lab/internal/git"
	lab "github.com/zaquestion/lab/internal/gitlab"
)

// mrCheckoutConfig holds configuration values for calls to lab mr checkout
type mrCheckoutConfig struct {
	branch string
	force  bool
	track  bool
}

var (
	mrCheckoutCfg mrCheckoutConfig
)

// listCmd represents the list command
var checkoutCmd = &cobra.Command{
	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
		lab mr checkout a_remote -f
		lab mr checkout upstream --https
		lab mr checkout upstream -t`),
	PersistentPreRun: labPersistentPreRun,
	Run: func(cmd *cobra.Command, args []string) {
		rn, mrID, err := parseArgsRemoteAndID(args)
		if err != nil {
			log.Fatal(err)
		}

		targetRemote := defaultRemote
		if len(args) == 2 {
{'fraction_non_alphanumeric': 0.1066447908121411, 'fraction_numerical': 0.006562756357670222, 'mean_word_length': 4.178343949044586, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1411399', 'n_tokens_mistral': 922, 'n_tokens_neox': 850, 'n_words': 243}