(ctx context.Context)
| 101 | } |
| 102 | |
| 103 | func (c *BatchShowCmd) Run(ctx context.Context) error { |
| 104 | batchID := strings.TrimSpace(c.BatchID) |
| 105 | if err := validateDocsBatchIDArg(batchID); err != nil { |
| 106 | return err |
| 107 | } |
| 108 | store, err := openDocsBatchStore(ctx) |
| 109 | if err != nil { |
| 110 | return err |
| 111 | } |
| 112 | state, err := store.Get(batchID) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | payload := map[string]any{ |
| 117 | "batch": state, |
| 118 | "payload": docsBatchWirePayload(state, state.Requests), |
| 119 | } |
| 120 | if outfmt.IsJSON(ctx) { |
| 121 | return outfmt.WriteJSON(ctx, stdoutWriter(ctx), payload) |
| 122 | } |
| 123 | |
| 124 | data, err := json.MarshalIndent(payload, "", " ") |
| 125 | if err != nil { |
| 126 | return err |
| 127 | } |
| 128 | ui.FromContext(ctx).Out().Println(string(data)) |
| 129 | |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | type BatchAbortCmd struct { |
| 134 | BatchID string `arg:"" name:"batchId" help:"Batch ID"` |
nothing calls this directly
no test coverage detected