<commit_before>package main

func initLoginSubCmd(app *cli.App) {
}<commit_msg>add login subcommand with -g and -n option<commit_after>package main

import (
	"fmt"
	"os"

	"github.com/urfave/cli"
)

func initLoginSubCmd(app *cli.App) {

	loginSubCmd := cli.Command{
		Name:        "login",
		Usage:       "login <options>",
		Description: "login to one node",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "g,group",
				Value: "*",
				Usage: "the group's node you want to login",
			},
			cli.StringFlag{
				Name:  "n,node",
				Value: "*",
				Usage: "the node you want to login",
			},
		},
		Action: func(c *cli.Context) error {
			// 如果有 --generate-bash-completion 参数, 则不执行默认命令
			if os.Args[len(os.Args)-1] == "--generate-bash-completion" {
				bashComplete(c)
				return nil
			}

			var groupName = c.String("group")
			var nodeName = c.String("node")
			var err error
			if err = loginNode(groupName, nodeName); err != nil {
				fmt.Println(err)
			}
			return err
		},
	}

	if app.Commands == nil {
		app.Commands = cli.Commands{loginSubCmd}
	} else {
		app.Commands = append(app.Commands, loginSubCmd)
	}
}

func loginNode(groupName, nodeName string) error {

	return nil
}
{'fraction_non_alphanumeric': 0.14681208053691275, 'fraction_numerical': 0.0008389261744966443, 'mean_word_length': 3.0033557046979866, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4007150', 'n_tokens_mistral': 512, 'n_tokens_neox': 447, 'n_words': 106}