lolly/main.go
xfy 77b0eccf4c refactor(app): 将应用逻辑抽取到 internal/app 包
将版本信息和核心运行逻辑从 main.go 移至 internal/app/app.go,
main.go 仅保留 CLI 参数解析和入口调用。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-02 14:12:06 +08:00

26 lines
643 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"flag"
"os"
"rua.plus/lolly/internal/app"
)
func main() {
cfgPath := flag.String("c", "lolly.yaml", "配置文件路径")
cfgPathLong := flag.String("config", "", "配置文件路径(长参数)")
genConfig := flag.Bool("generate-config", false, "生成默认配置")
outputPath := flag.String("o", "", "输出文件路径(配合 --generate-config")
showVersion := flag.Bool("v", false, "显示版本")
flag.Parse()
// 合并短参数和长参数
configPath := *cfgPath
if *cfgPathLong != "" {
configPath = *cfgPathLong
}
os.Exit(app.Run(configPath, *genConfig, *outputPath, *showVersion))
}