<commit_before>package main

import (
	"path"

	"github.com/anaminus/snek"
)

func DocumentCommands() {
	for _, def := range Program.List() {
		Program.SetDoc(def.Name, snek.Doc{
			Summary:     Doc(path.Join("commands", def.Name+".md", "Summary")),
			Arguments:   Doc(path.Join("commands", def.Name+".md", "Arguments")),
			Description: Doc(path.Join("commands", def.Name+".md", "Description")),
		})
	}
}<commit_msg>Capture flag documentation during initialization.<commit_after>package main

import (
	"flag"
	"path"

	"github.com/anaminus/snek"
)

func DocumentCommands() {
	for _, def := range Program.List() {
		Program.SetDoc(def.Name, snek.Doc{
			Summary:     Doc(path.Join("commands", def.Name+".md", "Summary")),
			Arguments:   Doc(path.Join("commands", def.Name+".md", "Arguments")),
			Description: Doc(path.Join("commands", def.Name+".md", "Description")),
		})
		if def, ok := def.New().(snek.FlagSetter); ok {
			def.SetFlags(flag.NewFlagSet("", 0))
		}
	}
}
{'fraction_non_alphanumeric': 0.20184426229508196, 'fraction_numerical': 0.0010245901639344263, 'mean_word_length': 4.427777777777778, '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': '563048', 'n_tokens_mistral': 371, 'n_tokens_neox': 347, 'n_words': 62}