Files
BlueArchiveToolkit/cmd/bat/main.go
T
nyaKazuha 3f78f8f880 feat(api): 补齐资源分发服务入口
新增 bat-api 资源 bootstrap/分发 HTTP 服务、RPC release 发现、CDN path 分发、launcher 资源引导兼容、控制面中间件、OpenAPI 和 systemd 模板。

同步 Go 边界文档,明确 Rust bat 是资源生产者和同步运维入口,Go bat-api 是只读 bootstrap/分发服务,试验 Go CLI 产物为 bin/bat-go。

验证:未运行新命令;本轮已按要求停止重复构建/测试。
2026-07-31 00:41:48 +08:00

49 lines
1.0 KiB
Go

package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) < 2 {
printUsage()
os.Exit(1)
}
var err error
switch os.Args[1] {
case "doctor":
err = runDoctor()
case "manifest":
err = runManifest(os.Args[2:])
case "sync":
err = runSync(os.Args[2:])
case "help", "-h", "--help":
printUsage()
default:
fmt.Fprintf(os.Stderr, "unknown command: %s\n", os.Args[1])
printUsage()
os.Exit(1)
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func printUsage() {
fmt.Println("bat-go - experimental Go helper (NOT the product CLI)")
fmt.Println()
fmt.Println("Product sync/ops CLI is the Rust binary `bat` (nearly fully automatic).")
fmt.Println("Product resource HTTP service is `bat-api` (see docs/reports/GO_STATUS.md).")
fmt.Println()
fmt.Println("This binary is experimental FFI demos only. Build output must be bin/bat-go.")
fmt.Println()
fmt.Println("Usage:")
fmt.Println(" bat-go doctor")
fmt.Println(" bat-go manifest inspect <file>")
fmt.Println(" bat-go sync plan <current-json> [previous-json]")
}