<commit_before>package main

import (
	"flag"
	"fmt"
)

type Flags struct {
	Directory  string // the directory to "fatbinarize"
	Executable string // the file to start on execution of the fatbin
}

func parseFlags() (Flags, error) {
	var dir, exec string

	flag.StringVar(&dir, "dir", "", "the directory to fatbinerize")
	flag.StringVar(&exec, "exec", "", "the file inside the directory to execute at startup")

	flag.Parse()

	flags := Flags{
		Directory:  dir,
		Executable: exec,
	}

	if len(dir) == 0 {
		return flags, fmt.Errorf("You must provide a directory. See flag -dir")
	}

	if len(exec) == 0 {
		return flags, fmt.Errorf("You must provide an executable to run. See flag -exec")
	}

	return flags, nil
}<commit_msg>Flags are global.<commit_after>package main

import (
	"flag"
	"fmt"
)

type Flags struct {
	Directory  string // the directory to "fatbinarize"
	Executable string // the file to start on execution of the fatbin
}

var flags Flags

func parseFlags() error {
	var dir, exec string

	flag.StringVar(&dir, "dir", "", "the directory to fatbinerize")
	flag.StringVar(&exec, "exec", "", "the file inside the directory to execute at startup")

	flag.Parse()

	f := Flags{
		Directory:  dir,
		Executable: exec,
	}

	if len(dir) == 0 {
		return fmt.Errorf("You must provide a directory. See flag -dir")
	}

	if len(exec) == 0 {
		return fmt.Errorf("You must provide an executable to run. See flag -exec")
	}

	flags = f
	return nil
}
{'fraction_non_alphanumeric': 0.12258953168044077, 'fraction_numerical': 0.0027548209366391185, 'mean_word_length': 3.657051282051282, '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': '4248096', 'n_tokens_mistral': 506, 'n_tokens_neox': 476, 'n_words': 179}