<commit_before>package main

import (
	"fmt"
	"os"

	"github.com/git-duet/git-duet"
	"github.com/pborman/getopt"
)

var (
	// VersionString is the git tag this binary is associated with
	VersionString string
	// RevisionString is the git rev this binary is associated with
	RevisionString string
)

func main() {
	var (
		quiet   = getopt.BoolLong("quiet", 'q', "Silence output")
		global  = getopt.BoolLong("global", 'g', "Change global config")
		help    = getopt.BoolLong("help", 'h', "Help")
		version = getopt.BoolLong("version", 'v', "Version")
	)

	getopt.Parse()

	if *help {
		getopt.Usage()
		os.Exit(0)
	}

	if *version {
		fmt.Printf("%s (%s)\n", VersionString, RevisionString)
		os.Exit(0)
	}

	configuration, err := duet.NewConfiguration()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	gitConfig := &duet.GitConfig{Namespace: configuration.Namespace, SetUserConfig: configuration.SetGitUserConfig}
	if *global || configuration.Global {
		gitConfig.Scope = duet.Global
	}

	if getopt.NArgs() == 0 {
		author, err := gitConfig.GetAuthor()
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		printAuthor(author)
		os.Exit(0)
	}

	pairs, err := duet.NewPairsFromFile(configuration.PairsFile, configuration.EmailLookup)
	if err != nil {
		fmt.Println(err)
		os.Exit(0)
	}

	author, err := pairs.ByInitials(getopt.Arg(0))<commit_msg>Fix #81: Clear duet committer when no args passed to git-solo<commit_after>package main

import (
	"fmt"
	"os"

	"github.com/git-duet/git-duet"
	"github.com/pborman/getopt"
)

var (
	// VersionString is the git tag this binary is associated with
	VersionString string
	// RevisionString is the git rev this binary is associated with
	RevisionString string
)

func main() {
	var (
		quiet   = getopt.BoolLong("quiet", 'q', "Silence output")
		global  = getopt.BoolLong("global", 'g', "Change global config")
		help    = getopt.BoolLong("help", 'h', "Help")
		version = getopt.BoolLong("version", 'v', "Version")
	)

	getopt.Parse()

	if *help {
		getopt.Usage()
		os.Exit(0)
	}

	if *version {
		fmt.Printf("%s (%s)\n", VersionString, RevisionString)
		os.Exit(0)
	}

	configuration, err := duet.NewConfiguration()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	gitConfig := &duet.GitConfig{Namespace: configuration.Namespace, SetUserConfig: configuration.SetGitUserConfig}
	if *global || configuration.Global {
		gitConfig.Scope = duet.Global
	}

	if getopt.NArgs() == 0 {
		author, err := gitConfig.GetAuthor()
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		if err = gitConfig.ClearCommitter(); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		printAuthor(author)
		os.Exit(0)
	}

	pairs, err := duet.NewPairsFromFile(configuration.PairsFile, configuration.EmailLookup)
	if err != nil {
		fmt.Println(err)
		os.Exit(0)
	}

	author, err := pairs.ByInitials(getopt.Arg(0))
{'fraction_non_alphanumeric': 0.14801823921431076, 'fraction_numerical': 0.006664328305857594, 'mean_word_length': 3.8257191201353637, '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': '4776347', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1045, 'n_words': 234}