(args []string, flags *core.CLIFlags)
| 61 | } |
| 62 | |
| 63 | func fix(args []string, flags *core.CLIFlags) error { |
| 64 | if len(args) != 1 { |
| 65 | return core.NewE100("fix", errors.New("one argument expected")) |
| 66 | } |
| 67 | |
| 68 | alert := args[0] |
| 69 | if system.FileExists(args[0]) { |
| 70 | b, err := os.ReadFile(args[0]) |
| 71 | if err != nil { |
| 72 | return err |
| 73 | } |
| 74 | alert = string(b) |
| 75 | } |
| 76 | |
| 77 | cfg, err := core.ReadPipeline(flags, false) |
| 78 | if err != nil { |
| 79 | return err |
| 80 | } |
| 81 | |
| 82 | resp, err := check.ParseAlert(alert, cfg) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | |
| 87 | return printJSON(resp) |
| 88 | } |
| 89 | |
| 90 | func sync(_ []string, flags *core.CLIFlags) error { |
| 91 | cfg, err := core.ReadPipeline(flags, true) |
nothing calls this directly
no test coverage detected