<commit_before>package commands

import (
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app"
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app/args"
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app/with"
	"github.com/urfave/cli"
)

func init() {
	serverFlag := cli.GenericFlag{
		Name:  "server",
		Usage: "the server to reset",
		Value: new(app.VirtualMachineNameFlag),
	}

	Commands = append(Commands, cli.Command{
		Name:        "reset",
		Usage:       "restart a server as though the reset button had been pushed FISMO",
		UsageText:   "reset server <server>",
		Description: "For cloud servers, this does not cause the qemu process to be restarted. This means that the server will remain on the same head and will not notice hardware changes.",
		Action:      cli.ShowSubcommandHelp,
		Flags: []cli.Flag{
			serverFlag,
		},
		Subcommands: []cli.Command{{
			Name:        "server",
			Usage:       "restart a server as though the reset button had been pushed",
			UsageText:   "reset server <server>",
			Description: "For cloud servers, this does not cause the qemu process to be restarted. This means that the server will remain on the same head and will not notice hardware changes.",
			Flags: []cli.Flag{
				serverFlag,
			},
			Action: resetServer,
		}},
	})
}

var resetServer = app.Action(args.Optional("server"), with.RequiredFlags("server"), with.Auth, func(c *app.Context) (err error) {
	vmName := c.VirtualMachineName("server")
	c.LogErr("Attempting to reset %v...\r\n", vmName)
	err = c.Client().ResetVirtualMachine(vmName)
	if err != nil {
		return err
	}

	c.LogErr("%v reset successfully.\r\n", vmName)
	return
})<commit_msg>move resetServer function back into the Command<commit_after>package commands

import (
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app"
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app/args"
	"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app/with"
	"github.com/urfave/cli"
)

func init() {
	serverFlag := cli.GenericFlag{
		Name:  "server",
		Usage: "the server to reset",
		Value: new(app.VirtualMachineNameFlag),
	}

	Commands = append(Commands, cli.Command{
		Name:        "reset",
		Usage:       "restart a server as though the reset button had been pushed FISMO",
		UsageText:   "reset server <server>",
		Description: "For cloud servers, this does not cause the qemu process to be restarted. This means that the server will remain on the same head and will not notice hardware changes.",
		Action:      cli.ShowSubcommandHelp,
		Flags: []cli.Flag{
			serverFlag,
		},
		Subcommands: []cli.Command{{
			Name:        "server",
			Usage:       "restart a server as though the reset button had been pushed",
			UsageText:   "reset server <server>",
			Description: "For cloud servers, this does not cause the qemu process to be restarted. This means that the server will remain on the same head and will not notice hardware changes.",
			Flags: []cli.Flag{
				serverFlag,
			},
			Action: app.Action(args.Optional("server"), with.RequiredFlags("server"), with.Auth, func(c *app.Context) (err error) {
				vmName := c.VirtualMachineName("server")
				c.LogErr("Attempting to reset %v...\r\n", vmName)
				err = c.Client().ResetVirtualMachine(vmName)
				if err != nil {
					return err
				}

				c.LogErr("%v reset successfully.\r\n", vmName)
				return
			}),
		}},
	})
}
{'fraction_non_alphanumeric': 0.12095350206003531, 'fraction_numerical': 0.0, 'mean_word_length': 3.7273991655076495, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2216743', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1081, 'n_words': 327}