<commit_before>package main

import (
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/keybase/go-libkb"
)

type CmdKeyGen struct {
	push       bool
	pushSecret bool
	debug      bool
	arg        libkb.KeyGenArg
}

func (v *CmdKeyGen) ParseArgv(ctx *cli.Context) error {
	nargs := len(ctx.Args())
	var err error
	v.push = ctx.Bool("push")
	v.pushSecret = ctx.Bool("push-secret")
	if nargs != 0 {
		err = fmt.Errorf("keygen takes 0 args")
	}
	v.debug = ctx.Bool("debug")
	if v.debug {
		// Speed up keygen to speed up debugging
		v.arg.PrimaryBits = 1024
		v.arg.SubkeyBits = 1024
	}
	return err
}

func (v *CmdKeyGen) Run() error {
	var err error
	if v.arg.Tsec, err = G.LoginState.GetTriplesec(""); err != nil {
		return err
	} else if _, err = libkb.KeyGen(v.arg); err != nil {
		return err
	}
	return nil
}

func NewCmdKeyGen(cl *CommandLine) cli.Command {
	return cli.Command{
		Name:        "keygen",
		Usage:       "keybase keygen",
		Description: "Generate a new PGP key and write to local secret keychain",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "p, push",
				Usage: "Push to server",
			},
			cli.BoolFlag{
				Name:  "push-secret",
				Usage: "Also push secret key to server (protected by passphrase)",
			},
			cli.BoolFlag{
				Name:  "d, debug",
				Usage: "Generate small keys for debugging",
			},
		},
		Action: func(c *cli.Context) {
			cl.ChooseCommand(&CmdKeyGen{}, "keygen", c)
		},
	}
}

func (v *CmdKeyGen) UseConfig() bool   { return true }<commit_msg>keygen<commit_after>package main

import (
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/keybase/go-libkb"
)

type CmdKeyGen struct {
	push       bool
	pushSecret bool
	debug      bool
	arg        libkb.KeyGenArg
}

func (v *CmdKeyGen) ParseArgv(ctx *cli.Context) error {
	nargs := len(ctx.Args())
	var err error
	v.push = ctx.Bool("push")
	v.pushSecret = ctx.Bool("push-secret")
	v.arg.NoPassphrase = ctx.Bool("no-passphrase")
	if nargs != 0 {
		err = fmt.Errorf("keygen takes 0 args")
	}
	v.debug = ctx.Bool("debug")
	if v.debug {
		// Speed up keygen to speed up debugging
		v.arg.PrimaryBits = 1024
		v.arg.SubkeyBits = 1024
	}
	return err
}

func (v *CmdKeyGen) Run() error {
	var err error
	if _, err = libkb.KeyGen(v.arg); err != nil {
		return err
	}
	return nil
}

func NewCmdKeyGen(cl *CommandLine) cli.Command {
	return cli.Command{
		Name:        "keygen",
		Usage:       "keybase keygen",
		Description: "Generate a new PGP key and write to local secret keychain",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "p, push",
				Usage: "Push to server",
			},
			cli.BoolFlag{
				Name:  "push-secret",
				Usage: "Also push secret key to server (protected by passphrase)",
			},
			cli.BoolFlag{
				Name:  "d, debug",
				Usage: "Generate small keys for debugging",
			},
			cli.BoolFlag{
				Name:  "P, no-passphrase",
				Usage: "Don't protect the key with a passphrase",
			},
		},
		Action: func(c *cli.Context) {
			cl.ChooseCommand(&CmdKeyGen{}, "keygen", c)
		},
	}
}

func (v *CmdKeyGen) UseConfig() bool   { return true }
{'fraction_non_alphanumeric': 0.13937397034596374, 'fraction_numerical': 0.006589785831960461, 'mean_word_length': 3.010568031704095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3893917', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1127, 'n_words': 309}