<commit_before>package client

import (
	"github.com/keybase/cli"
	"github.com/keybase/client/go/libcmdline"
	"github.com/keybase/client/go/libkb"
	keybase1 "github.com/keybase/client/go/protocol/keybase1"
	"golang.org/x/net/context"
)

type CmdTeamRequestAccess struct {
	libkb.Contextified
	Team string
}

func newCmdTeamRequestAccess(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
	return cli.Command{
		Name:         "request-access",
		ArgumentHelp: "<team name>",
		Usage:        "request access to a team",
		Action: func(c *cli.Context) {
			cmd := NewCmdTeamRequestAccessRunner(g)
			cl.ChooseCommand(cmd, "request-access", c)
		},
	}
}

func NewCmdTeamRequestAccessRunner(g *libkb.GlobalContext) *CmdTeamRequestAccess {
	return &CmdTeamRequestAccess{Contextified: libkb.NewContextified(g)}
}

func (c *CmdTeamRequestAccess) ParseArgv(ctx *cli.Context) error {
	var err error
	c.Team, err = ParseOneTeamName(ctx)
	if err != nil {
		return err
	}

	return nil
}

func (c *CmdTeamRequestAccess) Run() error {
	cli, err := GetTeamsClient(c.G())
	if err != nil {
		return err
	}

	arg := keybase1.TeamRequestAccessArg{
		Name: c.Team,
	}

	err = cli.TeamRequestAccess(context.Background(), arg)
	if err != nil {
		return err
	}

	dui := c.G().UI.GetDumbOutputUI()
	dui.Printf("An email has been sent to the admins of %s.\n", c.Team)

	return nil
}

func (c *CmdTeamRequestAccess) GetUsage() libkb.Usage {
	return libkb.Usage{
		Config:    true,
		API:       true,<commit_msg>small wording change requested (#7938)<commit_after>package client

import (
	"github.com/keybase/cli"
	"github.com/keybase/client/go/libcmdline"
	"github.com/keybase/client/go/libkb"
	keybase1 "github.com/keybase/client/go/protocol/keybase1"
	"golang.org/x/net/context"
)

type CmdTeamRequestAccess struct {
	libkb.Contextified
	Team string
}

func newCmdTeamRequestAccess(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
	return cli.Command{
		Name:         "request-access",
		ArgumentHelp: "<team name>",
		Usage:        "request access to a team",
		Action: func(c *cli.Context) {
			cmd := NewCmdTeamRequestAccessRunner(g)
			cl.ChooseCommand(cmd, "request-access", c)
		},
	}
}

func NewCmdTeamRequestAccessRunner(g *libkb.GlobalContext) *CmdTeamRequestAccess {
	return &CmdTeamRequestAccess{Contextified: libkb.NewContextified(g)}
}

func (c *CmdTeamRequestAccess) ParseArgv(ctx *cli.Context) error {
	var err error
	c.Team, err = ParseOneTeamName(ctx)
	if err != nil {
		return err
	}

	return nil
}

func (c *CmdTeamRequestAccess) Run() error {
	cli, err := GetTeamsClient(c.G())
	if err != nil {
		return err
	}

	arg := keybase1.TeamRequestAccessArg{
		Name: c.Team,
	}

	err = cli.TeamRequestAccess(context.Background(), arg)
	if err != nil {
		return err
	}

	dui := c.G().UI.GetDumbOutputUI()
	dui.Printf("If %q exists, an email has been sent to its admins, notifying of your request for access.\n", c.Team)

	return nil
}

func (c *CmdTeamRequestAccess) GetUsage() libkb.Usage {
	return libkb.Usage{
		Config:    true,
		API:       true,
{'fraction_non_alphanumeric': 0.12675138481590095, 'fraction_numerical': 0.0032583903551645487, 'mean_word_length': 4.168350168350169, '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': '4722150', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1100, 'n_words': 248}