<commit_before>package main

import (
	"flag"
	"log"
	"os"
)

// Args are command line arguments.
type Args struct {
	ConfigFile        string
	DatabaseDirectory string
	StackTrace        bool
	Verbose           bool
}

func getArgs() *Args {
	configFile := flag.String("f", "", "Configuration file (required)")
	databaseDirectory := flag.String("d", "", "Store databases in this directory (optional)")
	help := flag.Bool("h", false, "Display help and exit")
	stackTrace := flag.Bool("stack-trace", false, "Show a stack trace along with any error message.")
	verbose := flag.Bool("v", false, "Use verbose output")
	version := flag.Bool("V", false, "Display the version and exit")

	flag.Parse()

	if *help {
		printUsage()
	}
	if *version {
		log.Printf("geoipupdate %s", Version)
		os.Exit(0)
	}

	if *configFile == "" {
		log.Printf("You must provide a configuration file.")
		printUsage()
	}

	return &Args{
		ConfigFile:        *configFile,
		DatabaseDirectory: *databaseDirectory,
		StackTrace:        *stackTrace,
		Verbose:           *verbose,
	}
}
<commit_msg>Use pflag for argument parsing<commit_after>package main

import (
	"log"
	"os"

	flag "github.com/spf13/pflag"
)

// Args are command line arguments.
type Args struct {
	ConfigFile        string
	DatabaseDirectory string
	StackTrace        bool
	Verbose           bool
}

func getArgs() *Args {
	configFile := flag.StringP("config-file", "f", "", "Configuration file (required)")
	databaseDirectory := flag.StringP(
		"database-directory",
		"d",
		"",
		"Store databases in this directory (optional)",
	)
	help := flag.BoolP("help", "h", false, "Display help and exit")
	stackTrace := flag.Bool("stack-trace", false, "Show a stack trace along with any error message.")
	verbose := flag.BoolP("verbose", "v", false, "Use verbose output")
	version := flag.BoolP("version", "V", false, "Display the version and exit")

	flag.Parse()

	if *help {
		printUsage()
	}
	if *version {
		log.Printf("geoipupdate %s", Version)
		os.Exit(0)
	}

	if *configFile == "" {
		log.Printf("You must provide a configuration file.")
		printUsage()
	}

	return &Args{
		ConfigFile:        *configFile,
		DatabaseDirectory: *databaseDirectory,
		StackTrace:        *stackTrace,
		Verbose:           *verbose,
	}
}

{'fraction_non_alphanumeric': 0.14020344980097302, 'fraction_numerical': 0.0017691287041132243, 'mean_word_length': 3.5421686746987953, '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': '4404031', 'n_tokens_mistral': 751, 'n_tokens_neox': 721, 'n_words': 211}