<commit_before>package main

import (
	"errors"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"runtime/pprof"
	"strings"

	"github.com/fatih/hcl/printer"
)

var (
	write      = flag.Bool("w", false, "write result to (source) file instead of stdout")
	cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
)

func main() {
	if err := realMain(); err != nil {
		fmt.Fprintln(os.Stderr, err.Error())
		os.Exit(1)
	}
}

func realMain() error {
	flag.Usage = usage
	flag.Parse()

	if *cpuprofile != "" {
		f, err := os.Create(*cpuprofile)
		if err != nil {
			return fmt.Errorf("creating cpu profile: %s\n", err)
		}
		defer f.Close()
		pprof.StartCPUProfile(f)
		defer pprof.StopCPUProfile()
	}

	if flag.NArg() == 0 {
		if *write {<commit_msg>Add version flag which prints out current version of project and returns 0 (success)<commit_after>package main

import (
	"errors"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"runtime/pprof"
	"strings"

	"github.com/fatih/hcl/printer"
)

const Version = "0.1.0"

var (
	write      = flag.Bool("w", false, "write result to (source) file instead of stdout")
	cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
	version    = flag.Bool("version", false, "version information")
)

func main() {
	if err := realMain(); err != nil {
		fmt.Fprintln(os.Stderr, err.Error())
		os.Exit(1)
	}
}

func realMain() error {
	flag.Usage = usage
	flag.Parse()

	if *version {
		fmt.Println(Version)
		return nil
	}

	if *cpuprofile != "" {
		f, err := os.Create(*cpuprofile)
		if err != nil {
			return fmt.Errorf("creating cpu profile: %s\n", err)
		}
		defer f.Close()
		pprof.StartCPUProfile(f)
		defer pprof.StopCPUProfile()
	}

	if flag.NArg() == 0 {
		if *write {
{'fraction_non_alphanumeric': 0.16477916194790487, 'fraction_numerical': 0.004530011325028313, 'mean_word_length': 3.5191815856777495, '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': '2569271', 'n_tokens_mistral': 737, 'n_tokens_neox': 699, 'n_words': 172}