<commit_before>package main

import (
	"encoding/binary"
	kitlog "github.com/go-kit/kit/log"
	"github.com/jstesta/gomidi"
	"github.com/jstesta/gomidi/cfg"
	stdlog "log"
	"os"
)

func main() {

	logger := kitlog.NewLogfmtLogger(os.Stderr)
	stdlog.SetOutput(kitlog.NewStdlibAdapter(logger))

	ctx := kitlog.NewContext(logger).WithPrefix("ts", kitlog.DefaultTimestampUTC)

	m, err := gomidi.ReadMidiFromFile("resource/walzamin.mid", cfg.GomidiConfig{
		ByteOrder:  binary.BigEndian,
		LogContext: ctx,
	})
	if err != nil {
		stdlog.Fatal(err)
	}
	ctx.Log("midi", m)
}<commit_msg>Main now accepts the input file via command line flags<commit_after>package main

import (
	"encoding/binary"
	kitlog "github.com/go-kit/kit/log"
	"github.com/jstesta/gomidi"
	"github.com/jstesta/gomidi/cfg"
	stdlog "log"
	"os"
	"flag"
)

func main() {
	var (
		midiFile = flag.String("input", "", "Filesystem location of MIDI file to parse")
	)
	flag.Parse()

	logger := kitlog.NewLogfmtLogger(os.Stderr)
	stdlog.SetOutput(kitlog.NewStdlibAdapter(logger))

	logger.Log("midiFile", midiFile)

	ctx := kitlog.NewContext(logger).WithPrefix("ts", kitlog.DefaultTimestampUTC)

	m, err := gomidi.ReadMidiFromFile(*midiFile, cfg.GomidiConfig{
		ByteOrder:  binary.BigEndian,
		LogContext: ctx,
	})
	if err != nil {
		stdlog.Fatal(err)
	}
	ctx.Log("midi", m)
}
{'fraction_non_alphanumeric': 0.15199398043641835, 'fraction_numerical': 0.0, 'mean_word_length': 4.807860262008734, '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': '2083969', 'n_tokens_mistral': 543, 'n_tokens_neox': 524, 'n_words': 89}