修改git过滤文件

This commit is contained in:
zyj
2026-03-04 10:14:12 +08:00
parent a9f9330744
commit 89d64cb117
12 changed files with 570 additions and 1 deletions

View File

@@ -0,0 +1,51 @@
package commands
import (
"fmt"
"github.com/spf13/cobra"
)
func newListCmd() *cobra.Command {
var (
output string
detailed bool
)
cmd := &cobra.Command{
Use: "list [packs|profiles|collectors]",
Short: "列出 Pack、Profile 或采集器",
Long: `列出本地存储的 Pack、配置的 Profile 或所有可用的采集器。`,
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
subCmd := "packs"
if len(args) > 0 {
subCmd = args[0]
}
switch subCmd {
case "packs":
fmt.Println("📦 Local Packs:")
// TODO: List packs
fmt.Println(" (none)")
case "profiles":
fmt.Println("📋 Profiles:")
// TODO: List profiles
fmt.Println(" (none)")
case "collectors":
fmt.Println("🔌 Available Collectors:")
// TODO: List collectors
fmt.Println(" (none)")
default:
return fmt.Errorf("未知的子命令: %s (可选: packs, profiles, collectors)", subCmd)
}
return nil
},
}
cmd.Flags().StringVarP(&output, "output", "o", "table", "输出格式 (table|json|yaml)")
cmd.Flags().BoolVar(&detailed, "detailed", false, "显示详细信息")
return cmd
}