<commit_before>package main

import (
	"flag"
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
)

const (
	app_name    = "deblocus"
	project_url = "https://github.com/spance/delocus"
	ver_major   = uint8(0)
	ver_minor   = uint8(9)
	ver_build   = 10*uint16(245) + uint16(1)
)

var build_flag string // -ldflags "-X main.build_flag=-beta"

var version uint32

func init() {
	var ver uint32
	ver |= uint32(ver_major) << 24
	ver |= uint32(ver_minor) << 16
	ver |= uint32(ver_build)
	version = ver
}

func versionString() string {
	return fmt.Sprintf("%s version: v%d.%d.%04d%s\n", app_name, ver_major, ver_minor, ver_build, build_flag)
}

type CArg struct {
	literal string
	usage   string
	example string
}

func showUsage() {
	fmt.Printf("Usage: %s [-OPTION=VALUE]...\n", filepath.Base(os.Args[0]))
	fmt.Printf("%s project: <%s>\n", app_name, project_url)
	fmt.Println(versionString())

	var group = map[string][]*CArg{}
	var common = "Common"
	var reBool, _ = regexp.Compile("(?i)true|false")
	flag.VisitAll(func(f *flag.Flag) {
		var literal string
		if len(f.DefValue) > 0 && !reBool.MatchString(f.DefValue) {
			literal = fmt.Sprintf("-%s=%s", f.Name, f.DefValue)
		} else {
			literal = "-" + f.Name
		}
		array := strings.SplitN(f.Usage, ";;", 2)
		if len(array) != 2 {
			array = []string{common, f.Usage}
		}
		cArg := &CArg{literal: literal, usage: array[1]}
		if strings.Index(array[1], "//") >= 0 {
			ue := strings.SplitN(array[1], "//", 2)
			cArg.usage, cArg.example = ue[0], ue[1]
		}
		group[array[0]] = append(group[array[0]], cArg)
	})
	sk := make([]string, 0, len(group))
	for k := range group {
		sk = append(sk, k)
	}
	sort.Strings(sk)
	for _, k := range sk {
		fmt.Printf("%s options:\n", k)
		for _, i := range group[k] {
			fmt.Printf("  %-12s %s\n", i.literal, i.usage)
			if i.example != "" {
				fmt.Printf("  %-12s %s\n", " ", i.example)
			}
		}
	}
}
<commit_msg>update url<commit_after>package main

import (
	"flag"
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
)

const (
	app_name    = "deblocus"
	project_url = "https://github.com/Lafeng/delocus"
	ver_major   = uint8(0)
	ver_minor   = uint8(9)
	ver_build   = 10*uint16(245) + uint16(1)
)

var build_flag string // -ldflags "-X main.build_flag=-beta"

var version uint32

func init() {
	var ver uint32
	ver |= uint32(ver_major) << 24
	ver |= uint32(ver_minor) << 16
	ver |= uint32(ver_build)
	version = ver
}

func versionString() string {
	return fmt.Sprintf("%s version: v%d.%d.%04d%s\n", app_name, ver_major, ver_minor, ver_build, build_flag)
}

type CArg struct {
	literal string
	usage   string
	example string
}

func showUsage() {
	fmt.Printf("Usage: %s [-OPTION=VALUE]...\n", filepath.Base(os.Args[0]))
	fmt.Printf("%s project: <%s>\n", app_name, project_url)
	fmt.Println(versionString())

	var group = map[string][]*CArg{}
	var common = "Common"
	var reBool, _ = regexp.Compile("(?i)true|false")
	flag.VisitAll(func(f *flag.Flag) {
		var literal string
		if len(f.DefValue) > 0 && !reBool.MatchString(f.DefValue) {
			literal = fmt.Sprintf("-%s=%s", f.Name, f.DefValue)
		} else {
			literal = "-" + f.Name
		}
		array := strings.SplitN(f.Usage, ";;", 2)
		if len(array) != 2 {
			array = []string{common, f.Usage}
		}
		cArg := &CArg{literal: literal, usage: array[1]}
		if strings.Index(array[1], "//") >= 0 {
			ue := strings.SplitN(array[1], "//", 2)
			cArg.usage, cArg.example = ue[0], ue[1]
		}
		group[array[0]] = append(group[array[0]], cArg)
	})
	sk := make([]string, 0, len(group))
	for k := range group {
		sk = append(sk, k)
	}
	sort.Strings(sk)
	for _, k := range sk {
		fmt.Printf("%s options:\n", k)
		for _, i := range group[k] {
			fmt.Printf("  %-12s %s\n", i.literal, i.usage)
			if i.example != "" {
				fmt.Printf("  %-12s %s\n", " ", i.example)
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.19541743481696075, 'fraction_numerical': 0.02528311825125099, 'mean_word_length': 3.532219570405728, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '4455623', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1574, 'n_words': 331}