mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-20 17:08:01 +00:00
- meta: CORE_PLUGIN_RELOAD_ONE(48) / LIST_LOADED(49) / IS_DISABLED(50) - sdk: PluginMgrAPI 接口(ReloadOne/ListLoadedPlugins/IsPluginDisabled) + PluginSDK.SetPluginMgrAPI/PluginMgr() 访问器 - plugindev 模板: dispatchPluginMgr 桥接注入,走 C ABI 48/49/50
50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
help()
|
|
return
|
|
}
|
|
switch os.Args[1] {
|
|
case "init":
|
|
cmdInit(os.Args[2:])
|
|
case "build":
|
|
cmdBuild(os.Args[2:])
|
|
case "clean":
|
|
cmdClean(os.Args[2:])
|
|
case "debug":
|
|
cmdDebug(os.Args[2:])
|
|
case "sdk":
|
|
cmdSDK(os.Args[2:])
|
|
default:
|
|
help()
|
|
}
|
|
}
|
|
|
|
func help() {
|
|
fmt.Print(`HomeAgent Plugin Dev Tool
|
|
|
|
Usage:
|
|
plugindev init <name> Scaffold a new plugin project
|
|
plugindev init <name> --lua Create Lua plugin
|
|
plugindev init <name> --type remotedevice
|
|
Create C remote device adapter
|
|
plugindev build [flags] Compile and package plugin
|
|
plugindev clean Clean build/dist artifacts
|
|
plugindev debug [dir] Interpret and debug plugin source
|
|
plugindev sdk <command> Manage SDK versions
|
|
|
|
Flags:
|
|
--outdir Output directory (default: dist)
|
|
--target Target OS/arch (e.g. linux/amd64), repeatable
|
|
--lua Create Lua plugin (for init)
|
|
--type Project type: "remotedevice" (for init)
|
|
-t Alias for --type
|
|
`)
|
|
}
|