<commit_before>package main

import (
	"fmt"
	"os"

	"github.com/mkideal/cli"
	"github.com/perriea/tfversion/github"
	"github.com/perriea/tfversion/terraform/cloud/aws"
	"github.com/perriea/tfversion/terraform/init"
	"github.com/perriea/tfversion/terraform/install"
	"github.com/perriea/tfversion/terraform/list"
	"github.com/perriea/tfversion/terraform/uninstall"
)

var help = cli.HelpCommand("display help informations")
var tfversion = "0.1.2"

// root command
type rootT struct {
	cli.Helper
	Version bool `cli:"v,version" usage:"show version and check update"`
}

var root = &cli.Command{
	Desc: fmt.Sprintf("tfversion v%s \n\n\033[1mUsage:\033[0m\n\n  tfversion <command> [option]", tfversion),
	Argv: func() interface{} { return new(rootT) },
	OnRootBefore: func(ctx *cli.Context) error {
		tfinit.CreateTree()
		return nil
	},
	Fn: func(ctx *cli.Context) error {
		argv := ctx.Argv().(*rootT)

		// AutoHelper
		if argv.Help || len(os.Args) == 1 {
			ctx.WriteUsage()
			return nil
		}

		if argv.Version {
			fmt.Printf("tfversion v%s\n\n", tfversion)

			// Show if the last version
			lastrelease, release := tfgithub.Lastversion(tfversion)
			if !lastrelease && release != nil {
				fmt.Printf("Your version is out of date ! The latest version is %s. You can update by downloading from Github (%s).", *release.TagName, *release.HTMLURL)
			}
			return nil
		}
		return nil
	},
}

// install command
type installT struct {
	cli.Helper
	Version string `cli:"*version" usage:"install or switch version"`
}

var install = &cli.Command{
	Name: "install",
	Desc: "install new versions or switch.",
	Argv: func() interface{} { return new(installT) },
	OnBefore: func(ctx *cli.Context) error {
		tfinit.CreateTree()
		return nil
	},
	Fn: func(ctx *cli.Context) error {
		argv := ctx.Argv().(*installT)

		tfinstall.Run(argv.Version)
		return nil
	},
}<commit_msg>+ Add in command install option -v<commit_after>package main

import (
	"fmt"
	"os"

	"github.com/mkideal/cli"
	"github.com/perriea/tfversion/github"
	"github.com/perriea/tfversion/terraform/cloud/aws"
	"github.com/perriea/tfversion/terraform/init"
	"github.com/perriea/tfversion/terraform/install"
	"github.com/perriea/tfversion/terraform/list"
	"github.com/perriea/tfversion/terraform/uninstall"
)

var help = cli.HelpCommand("display help informations")
var tfversion = "0.1.2"

// root command
type rootT struct {
	cli.Helper
	Version bool `cli:"v,version" usage:"show version and check update"`
}

var root = &cli.Command{
	Desc: fmt.Sprintf("tfversion v%s \n\n\033[1mUsage:\033[0m\n\n  tfversion <command> [option]", tfversion),
	Argv: func() interface{} { return new(rootT) },
	OnRootBefore: func(ctx *cli.Context) error {
		tfinit.CreateTree()
		return nil
	},
	Fn: func(ctx *cli.Context) error {
		argv := ctx.Argv().(*rootT)

		// AutoHelper
		if argv.Help || len(os.Args) == 1 {
			ctx.WriteUsage()
			return nil
		}

		if argv.Version {
			fmt.Printf("tfversion v%s\n\n", tfversion)

			// Show if the last version
			lastrelease, release := tfgithub.Lastversion(tfversion)
			if !lastrelease && release != nil {
				fmt.Printf("Your version is out of date ! The latest version is %s. You can update by downloading from Github (%s).", *release.TagName, *release.HTMLURL)
			}
			return nil
		}
		return nil
	},
}

// install command
type installT struct {
	cli.Helper
	Version string `cli:"*v,version" usage:"install or switch version"`
}

var install = &cli.Command{
	Name: "install",
	Desc: "install new versions or switch.",
	Argv: func() interface{} { return new(installT) },
	OnBefore: func(ctx *cli.Context) error {
		tfinit.CreateTree()
		return nil
	},
	Fn: func(ctx *cli.Context) error {
		argv := ctx.Argv().(*installT)

		tfinstall.Run(argv.Version)
		return nil
	},
}
{'fraction_non_alphanumeric': 0.14764565043894654, 'fraction_numerical': 0.006384676775738229, 'mean_word_length': 3.9735449735449735, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1908664', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1346, 'n_words': 322}