<commit_before>package main

import (
	"fmt"
	"github.com/albrow/prtty"
	"github.com/albrow/temple"
	"github.com/spf13/cobra"
)

const (
	version = "temple version X.X.X (develop)"
)

func main() {
	// Define build command
	cmdBuild := &cobra.Command{
		Use:   "build <src> <dest>",
		Short: "Compile the templates in the src directory and write generated go code to the dest file.",
		Long:  ``,
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) != 2 {
				prtty.Error.Fatal("temple build requires exactly 2 arguments: the src directory and the dest file.")
			}
			partials := cmd.Flag("partials").Value.String()
			layouts := cmd.Flag("layouts").Value.String()
			if err := temple.Build(args[0], args[1], partials, layouts); err != nil {
				prtty.Error.Fatal(err)
			}
		},
	}
	cmdBuild.Flags().String("partials", "", "(optional) The directory to look for partials. Partials are .tmpl files that are associated with layouts and all other templates.")
	cmdBuild.Flags().String("layouts", "", "(optional) The directory to look for layouts. Layouts are .tmpl files which have access to partials and are associated with all other templates.")

	// Define version command
	cmdVersion := &cobra.Command{
		Use:   "version",<commit_msg>Add verbose flag and set it to false by default<commit_after>package main

import (
	"fmt"
	"github.com/albrow/prtty"
	"github.com/albrow/temple"
	"github.com/spf13/cobra"
	"io/ioutil"
	"os"
)

const (
	version = "temple version X.X.X (develop)"
)

var (
	verbose = false
)

func setQuiet() {
	prtty.AllLoggers.SetOutput(ioutil.Discard)
	prtty.Error.Output = os.Stderr
}

func setVerbose() {
	prtty.AllLoggers.SetOutput(os.Stdout)
	prtty.Error.Output = os.Stderr
}

func main() {
	// Define build command
	cmdBuild := &cobra.Command{
		Use:   "build <src> <dest>",
		Short: "Compile the templates in the src directory and write generated go code to the dest file.",
		Long:  ``,
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) != 2 {
				prtty.Error.Fatal("temple build requires exactly 2 arguments: the src directory and the dest file.")
			}
			if verbose {
				setVerbose()
			} else {
				setQuiet()
			}
			partials := cmd.Flag("partials").Value.String()
			layouts := cmd.Flag("layouts").Value.String()
			if err := temple.Build(args[0], args[1], partials, layouts); err != nil {
				prtty.Error.Fatal(err)
			}
		},
	}
	cmdBuild.Flags().String("partials", "", "(optional) The directory to look for partials. Partials are .tmpl files that are associated with layouts and all other templates.")
	cmdBuild.Flags().String("layouts", "", "(optional) The directory to look for layouts. Layouts are .tmpl files which have access to partials and are associated with all other templates.")
	cmdBuild.Flags().BoolVarP(&verbose, "verbose", "v", false, "If set to true, temple will print out information while building.")

	// Define version command
	cmdVersion := &cobra.Command{
		Use:   "version",
{'fraction_non_alphanumeric': 0.13952702702702702, 'fraction_numerical': 0.004054054054054054, 'mean_word_length': 3.886138613861386, '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': '3347858', 'n_tokens_mistral': 1057, 'n_tokens_neox': 970, 'n_words': 299}