refactor platform logic and add gasorder domain

This commit is contained in:
david
2026-07-28 10:42:26 +08:00
parent 8c6d52cf8c
commit 899fc6186b
44 changed files with 1636 additions and 1446 deletions

View File

@@ -1,4 +1,4 @@
// 平台 API 的版本命令行工具。
// 平台 API 命令行工具。
package main
import (
@@ -8,12 +8,24 @@ import (
func main() {
if len(os.Args) < 2 {
fmt.Println("usage: platform-cli <version>")
return
}
if os.Args[1] != "version" {
fmt.Fprintf(os.Stderr, "unknown command: %s\n", os.Args[1])
printUsage()
os.Exit(1)
}
switch os.Args[1] {
case "version":
fmt.Println("platform-cli 0.1.0")
case "resource-contract":
if err := writeResourceContract(os.Stdout); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
default:
fmt.Fprintf(os.Stderr, "unknown command: %s\n", os.Args[1])
printUsage()
os.Exit(1)
}
fmt.Println("platform-cli 0.1.0")
}
func printUsage() {
fmt.Fprintln(os.Stderr, "usage: platform-cli <version|resource-contract>")
}