初始化项目
This commit is contained in:
30
agent-wdd/cmd/Config.go
Normal file
30
agent-wdd/cmd/Config.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"agent-wdd/config"
|
||||
"agent-wdd/log"
|
||||
"agent-wdd/utils"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func addConfigSubcommands(cmd *cobra.Command) {
|
||||
|
||||
showConfigCmd := &cobra.Command{
|
||||
Use: "show",
|
||||
Short: "显示agent运行配置",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
log.Info("显示agent运行配置")
|
||||
|
||||
content := utils.ReadAllContentFromFile(config.WddConfigFilePath)
|
||||
|
||||
utils.BeautifulPrintListWithTitle(content, "agent运行配置")
|
||||
|
||||
log.Info("显示agent运行配置完成")
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
cmd.AddCommand(showConfigCmd)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user