(endpoints params.ForgeEndpoints)
| 267 | } |
| 268 | |
| 269 | func formatEndpoints(endpoints params.ForgeEndpoints) { |
| 270 | if outputFormat == common.OutputFormatJSON { |
| 271 | printAsJSON(endpoints) |
| 272 | return |
| 273 | } |
| 274 | t := table.NewWriter() |
| 275 | header := table.Row{"Name", "Base URL", "Description"} |
| 276 | if long { |
| 277 | header = append(header, "Created At", "Updated At") |
| 278 | } |
| 279 | t.AppendHeader(header) |
| 280 | for _, val := range endpoints { |
| 281 | row := table.Row{val.Name, val.BaseURL, val.Description} |
| 282 | if long { |
| 283 | row = append(row, val.CreatedAt, val.UpdatedAt) |
| 284 | } |
| 285 | t.AppendRow(row) |
| 286 | t.AppendSeparator() |
| 287 | } |
| 288 | fmt.Println(t.Render()) |
| 289 | } |
| 290 | |
| 291 | func formatOneEndpoint(endpoint params.ForgeEndpoint) { |
| 292 | if outputFormat == common.OutputFormatJSON { |
no test coverage detected