2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 05:31:44 +08:00

feat: cli 路由支持

This commit is contained in:
耗子
2024-09-19 01:37:39 +08:00
parent dded5e26aa
commit 407203dcfa
8 changed files with 76 additions and 40 deletions

26
internal/bootstrap/cli.go Normal file
View File

@@ -0,0 +1,26 @@
package bootstrap
import (
"fmt"
"os"
"github.com/urfave/cli/v2"
"github.com/TheTNB/panel/internal/panel"
"github.com/TheTNB/panel/internal/route"
)
func initCli() {
app := &cli.App{
Name: "panel-cli",
HelpName: fmt.Sprintf("耗子面板 %s", panel.Version),
Usage: "命令行工具",
UsageText: "panel-cli [global options] command [command options] [arguments...]",
HideVersion: true,
Commands: route.Cli(),
}
if err := app.Run(os.Args); err != nil {
panic(fmt.Sprintf("failed to run cli: %v", err))
}
}