saastool增加docker/daemon模式

This commit is contained in:
algotao
2025-09-24 18:38:03 +08:00
parent a88c5c6e3f
commit d7ab7b5156
14 changed files with 1023 additions and 120 deletions

43
cmd/saastool/exp.go Normal file
View File

@@ -0,0 +1,43 @@
package main
import (
"fmt"
"os"
"strings"
)
func RunExp(args ...string) error {
name, args := ParseCommandName(args)
// 从参数中解析出命令
switch name {
case "", "help":
return RunExpHelp(args...)
case "list":
return RunExpList(args...)
case "get":
return RunExpGet(args...)
default:
err := fmt.Errorf(`unknown command "%s"`+"\n"+`Run 'saastool exp help' for usage`, name)
fmt.Fprintln(os.Stderr, err)
return err
}
}
func RunExpHelp(args ...string) error {
fmt.Println(strings.TrimSpace(expUsage))
return nil
}
const expUsage = `
Usage: saastoola exp COMMAND [OPTIONS]
Commands:
list List exps
get Get exp report
"help" is the default command.
Use "saastool exp COMMAND -help" for more information about a command.
`