<commit_before>package main

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"strings"

	"github.com/aryann/difflib"
	"github.com/tucnak/climax"

	"bitbucket.org/homemade/scl"
)

func main() {
	app := climax.New("scl")
	app.Brief = "Scl is a tool for managing SCL soure code."
	app.Version = "1.1.0"

	app.AddCommand(runCommand(os.Stdout, os.Stderr))
	app.AddCommand(testCommand(os.Stdout, os.Stderr))

	app.Run()
}

func runCommand(stdout io.Writer, stderr io.Writer) climax.Command {

	return climax.Command{
		Name:  "run",
		Brief: "Transform one or more .scl files into HCL",
		Usage: `[options] <filename.scl> [filenameX.scl...]`,
		Help:  `Transform one or more .scl files into HCL. Output is written to stdout.`,

		Flags: standardParserParams(),

		Handle: func(ctx climax.Context) int {

			if len(ctx.Args) == 0 {
				fmt.Fprintf(stderr, "At least one filename is required. See `sep help run` for syntax")
				return 1
			}

			params, includePaths := parserParams(ctx)

			for _, fileName := range ctx.Args {

				parser, err := scl.NewParser(scl.NewDiskSystem())

				if err != nil {
					fmt.Fprintf(stderr, "Error: Unable to create new parser in CWD: %s\n", err.Error())
					return 1
				}<commit_msg>Return the exit code when program ends<commit_after>package main

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"strings"

	"github.com/aryann/difflib"
	"github.com/tucnak/climax"

	"bitbucket.org/homemade/scl"
)

func main() {
	app := climax.New("scl")
	app.Brief = "Scl is a tool for managing SCL soure code."
	app.Version = "1.1.0"

	app.AddCommand(runCommand(os.Stdout, os.Stderr))
	app.AddCommand(testCommand(os.Stdout, os.Stderr))

	os.Exit(app.Run())
}

func runCommand(stdout io.Writer, stderr io.Writer) climax.Command {

	return climax.Command{
		Name:  "run",
		Brief: "Transform one or more .scl files into HCL",
		Usage: `[options] <filename.scl> [filenameX.scl...]`,
		Help:  `Transform one or more .scl files into HCL. Output is written to stdout.`,

		Flags: standardParserParams(),

		Handle: func(ctx climax.Context) int {

			if len(ctx.Args) == 0 {
				fmt.Fprintf(stderr, "At least one filename is required. See `sep help run` for syntax")
				return 1
			}

			params, includePaths := parserParams(ctx)

			for _, fileName := range ctx.Args {

				parser, err := scl.NewParser(scl.NewDiskSystem())

				if err != nil {
					fmt.Fprintf(stderr, "Error: Unable to create new parser in CWD: %s\n", err.Error())
					return 1
				}
{'fraction_non_alphanumeric': 0.14337641357027464, 'fraction_numerical': 0.004846526655896607, 'mean_word_length': 3.48731884057971, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5167273', 'n_tokens_mistral': 1025, 'n_tokens_neox': 909, 'n_words': 246}