mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 05:31:44 +08:00
feat: cli 路由支持
This commit is contained in:
26
internal/bootstrap/cli.go
Normal file
26
internal/bootstrap/cli.go
Normal 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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user