<commit_before>package main

import (
	"fmt"
	"os"

	"github.com/mkideal/cli"
)

type argT struct {
	cli.Helper
	Config string `cli:"*c,config" usage:"Config file"`
}

func (argv *argT) Validate(ctx *cli.Context) error {
	if _, err := os.Stat(argv.Config); os.IsNotExist(err) {
		return fmt.Errorf("%s does not exist", argv.Config)
	}
	return nil
}

func main() {
	cli.Run(&argT{}, func(ctx *cli.Context) error {
		argv := ctx.Argv().(*argT)
		ctx.String("Hello, %s!\n", argv.Config)
		return nil
	})
}<commit_msg>Add config.json parser and version number<commit_after>package main

import (
	"encoding/json"
	"fmt"
	"os"

	"github.com/mkideal/cli"
)

const toolVersion = "0.0.1"

type configuration struct {
	Sites     []string
	Endpoints map[string]bool
}

type argT struct {
	cli.Helper
	Config  string `cli:"c,config" usage:"JSON config file {\"sites:\" [\"https://www.example.com\"], \"endpoints\": {\"index.php\": false, \"wp-admin/users.php\": true}}"`
	Version bool   `cli:"version" usage:"Check version"`
}

func main() {
	cli.Run(&argT{}, func(ctx *cli.Context) error {
		argv := ctx.Argv().(*argT)
		if argv.Version {
			ctx.String("ba_checker v%s\n", toolVersion)
			return nil
		}
		if argv.Config == "" {
			return fmt.Errorf("--config <config.json> is required.\n")
		}
		if _, err := os.Stat(argv.Config); os.IsNotExist(err) {
			return fmt.Errorf("Error: %s does not exist", argv.Config)
		}
		file, _ := os.Open(argv.Config)
		decoder := json.NewDecoder(file)
		config := configuration{}
		err := decoder.Decode(&config)
		if err != nil {
			fmt.Println("error:", err)
		}
		fmt.Printf("%v\n", config.Endpoints)
		return nil
	})
}
{'fraction_non_alphanumeric': 0.18446601941747573, 'fraction_numerical': 0.0018203883495145632, 'mean_word_length': 3.7658959537572256, 'pattern_counts': {'":': 3, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '6017441', 'n_tokens_mistral': 647, 'n_tokens_neox': 611, 'n_words': 140}