<commit_before>package command

import (
	"fmt"

	"github.com/Sirupsen/logrus"
	"github.com/mitchellh/cli"
	v1payload "github.com/nerdalize/nerd/nerd/client/batch/v1/payload"
	"github.com/pkg/errors"
)

// SecretCreateOpts describes the options to the SecretCreate command
type SecretCreateOpts struct {
	DockerServer   string `long:"docker-server" default:"" default-mask:"" description:"https://index.docker.io/v1/': Server location for Docker registry"`
	DockerUsername string `long:"docker-username" default:"" default-mask:"" description:"Username for Docker registry authentication"`
	DockerPassword string `long:"docker-password" default:"" default-mask:"" description:"Password for Docker registry authentication"`
	DockerEmail    string `long:"docker-email" default:"" default-mask:"" description:"email for Docker registry"`
}

//SecretCreate command
type SecretCreate struct {
	*command
	opts *SecretCreateOpts
}

//SecretCreateFactory returns a factory method for the join command
func SecretCreateFactory() (cli.Command, error) {
	opts := &SecretCreateOpts{}
	comm, err := newCommand("nerd secret create <name> [key] [value]", "create secrets to be used by workers", "", opts)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create command")
	}
	cmd := &SecretCreate{
		command: comm,
		opts:    opts,
	}
	cmd.runFunc = cmd.DoRun

	return cmd, nil
}

//DoRun is called by run and allows an error to be returned
func (cmd *SecretCreate) DoRun(args []string) (err error) {
	isPullSecret := cmd.opts.DockerServer != "" &&
		cmd.opts.DockerUsername != "" &&
		cmd.opts.DockerPassword != "" &&
		cmd.opts.DockerEmail != ""

	if len(args) < 3 && !isPullSecret {
		return fmt.Errorf("not enough arguments, see --help")
	} else if len(args) < 1 {
		return fmt.Errorf("please provide a pull secret name")
	}

	bclient, err := NewClient(cmd.config, cmd.session, cmd.outputter)
	if err != nil {
		HandleError(err)
	}

	ss, err := cmd.session.Read()
	if err != nil {
		HandleError(err)
	}
<commit_msg>Fix defaults<commit_after>package command

import (
	"fmt"

	"github.com/Sirupsen/logrus"
	"github.com/mitchellh/cli"
	v1payload "github.com/nerdalize/nerd/nerd/client/batch/v1/payload"
	"github.com/pkg/errors"
)

// SecretCreateOpts describes the options to the SecretCreate command
type SecretCreateOpts struct {
	DockerServer   string `long:"docker-server" default:"" default-mask:"" description:"https://index.docker.io/v1/': Server location for Docker registry"`
	DockerUsername string `long:"docker-username" default:"" default-mask:"" description:"Username for Docker registry authentication"`
	DockerPassword string `long:"docker-password" default:"" default-mask:"" description:"Password for Docker registry authentication"`
	DockerEmail    string `long:"docker-email" default:"" default-mask:"" description:"email for Docker registry"`
}

//SecretCreate command
type SecretCreate struct {
	*command
	opts *SecretCreateOpts
}

//SecretCreateFactory returns a factory method for the join command
func SecretCreateFactory() (cli.Command, error) {
	opts := &SecretCreateOpts{}
	comm, err := newCommand("nerd secret create <name> [key] [value]", "create secrets to be used by workers", "", opts)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create command")
	}
	cmd := &SecretCreate{
		command: comm,
		opts:    opts,
	}
	cmd.runFunc = cmd.DoRun

	return cmd, nil
}

//DoRun is called by run and allows an error to be returned
func (cmd *SecretCreate) DoRun(args []string) (err error) {
	isPullSecret := cmd.opts.DockerUsername != "" && cmd.opts.DockerPassword != ""

	if len(args) < 3 && !isPullSecret {
		return fmt.Errorf("not enough arguments, see --help")
	} else if len(args) < 1 {
		return fmt.Errorf("please provide a pull secret name")
	}

	bclient, err := NewClient(cmd.config, cmd.session, cmd.outputter)
	if err != nil {
		HandleError(err)
	}

	ss, err := cmd.session.Read()
	if err != nil {
		HandleError(err)
	}

{'fraction_non_alphanumeric': 0.13390601313794845, 'fraction_numerical': 0.0025265285497726125, 'mean_word_length': 4.721098265895954, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1745726', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1227, 'n_words': 361}