增加saastool功能

This commit is contained in:
2025-04-01 20:06:06 +08:00
parent 1793e2c3d9
commit 942efe107d
32 changed files with 5609 additions and 236 deletions

33
cmd/saastool/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 "write":
return RunWrite(args...)
//case "read":
// return RunRead(args...)
default:
err := fmt.Errorf(`unknown command "%s"`+"\n"+`Run 'dmptool help' for usage`, name)
slog.Warn(err.Error())
return err
}
}