首次提交代码

This commit is contained in:
algotao
2025-11-03 14:37:59 +08:00
parent e60f64721c
commit d76c196fb1
311 changed files with 81709 additions and 0 deletions

33
main.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"fmt"
"log/slog"
"os"
)
func main() {
if err := Run(os.Args[1:]...); err != nil {
os.Exit(1)
}
}
func Run(args ...string) error {
name, args := ParseCommandName(args)
// 从参数中解析出命令
switch name {
case "", "help":
return RunHelp(args...)
case "makebloom":
return RunMakeBloom(args...)
case "hittest":
return RunHitTest(args...)
case "info":
return RunInfo(args...)
default:
err := fmt.Errorf(`unknown command "%s"`+"\n"+`Run 'bloomtool help' for usage`, name)
slog.Warn(err.Error())
return err
}
}