(cmd *cobra.Command, args []string)
| 77 | } |
| 78 | |
| 79 | func create(cmd *cobra.Command, args []string) error { |
| 80 | if len(args) == 0 { |
| 81 | return fmt.Errorf("rule name is required") |
| 82 | } |
| 83 | if tacticID != "" && tactics[tacticID] == "" { |
| 84 | tacts := fmt.Sprintf("Did you mean any of %s?", strings.Join(convert.MapKeysToSlice(tactics), ", ")) |
| 85 | return fmt.Errorf("invalid tactic id: %s. %s", tacticID, tacts) |
| 86 | } |
| 87 | return createRule(args[0]) |
| 88 | } |
| 89 | |
| 90 | func emo(s string, args ...any) { fmt.Printf(s, args...) } |
nothing calls this directly
no test coverage detected