<commit_before>package main

import "os"

var targetNames = map[string]string{
	`linux_386`:     `linux/386`,
	`linux_amd64`:   `linux/amd64`,
	`linux_arm5`:    `linux/arm-5`,
	`linux_arm6`:    `linux/arm-6`,
	`linux_arm7`:    `linux/arm-7`,
	`linux_arm64`:   `linux/arm64`,
	`darwin_amd64`:  `darwin/amd64`,
	`windows_386`:   `windows/386`,
	`windows_amd64`: `windows/amd64`,
}

func main() {
	var targets []string
	var minify bool
	switch len(os.Args) {
	case 3:
		minify = os.Args[2] == `m` || os.Args[2] == `min`
		if t, y := targetNames[os.Args[1]]; y {
			targets = append(targets, t)
		}
	case 2:
		if os.Args[1] == `m` || os.Args[1] == `min` {
			minify = true
		} else {
			if t, y := targetNames[os.Args[1]]; y {
				targets = append(targets, t)
			}
		}
	case 1:
		for _, t := range targetNames {
			targets = append(targets, t)
		}
	}
	_ = minify
	_ = targets
}
<commit_msg>update-builder<commit_after>package main

import (
	"os"
	"regexp"

	"github.com/webx-top/com"
)

var targetNames = map[string]string{
	`linux_386`:     `linux/386`,
	`linux_amd64`:   `linux/amd64`,
	`linux_arm5`:    `linux/arm-5`,
	`linux_arm6`:    `linux/arm-6`,
	`linux_arm7`:    `linux/arm-7`,
	`linux_arm64`:   `linux/arm64`,
	`darwin_amd64`:  `darwin/amd64`,
	`windows_386`:   `windows/386`,
	`windows_amd64`: `windows/amd64`,
}

var armRegexp = regexp.MustCompile(`/arm`)

func main() {
	var targets []string
	var armTargets []string
	addTarget := func(target string, notNames ...bool) {
		if len(notNames) == 0 || !notNames[0] {
			target = getTarget(target)
			if len(target) == 0 {
				return
			}
		}
		if armRegexp.MatchString(target) {
			armTargets = append(armTargets, target)
		} else {
			targets = append(targets, target)
		}
	}
	var minify bool
	switch len(os.Args) {
	case 3:
		minify = isMinified(os.Args[2])
		addTarget(os.Args[1])
	case 2:
		if isMinified(os.Args[1]) {
			minify = true
		} else {
			addTarget(os.Args[1])
		}
	case 1:
		for _, t := range targetNames {
			addTarget(t, true)
		}
	default:
		com.ExitOnFailure(`参数错误`)
	}
	_ = minify
	_ = targets
	_ = armTargets
}

func getTarget(target string) string {
	if t, y := targetNames[target]; y {
		return t
	}
	for _, t := range targetNames {
		if t == target {
			return t
		}
	}
	return ``
}

func isMinified(arg string) bool {
	return arg == `m` || arg == `min`
}

{'fraction_non_alphanumeric': 0.1728712023962345, 'fraction_numerical': 0.037227214377406934, 'mean_word_length': 3.297794117647059, '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': '3071795', 'n_tokens_mistral': 1094, 'n_tokens_neox': 967, 'n_words': 202}