(creds []params.ForgeCredentials)
| 345 | } |
| 346 | |
| 347 | func formatGithubCredentials(creds []params.ForgeCredentials) { |
| 348 | if outputFormat == common.OutputFormatJSON { |
| 349 | printAsJSON(creds) |
| 350 | return |
| 351 | } |
| 352 | t := table.NewWriter() |
| 353 | header := table.Row{"ID", "Name", "Description", "Base URL", "API URL", "Upload URL", "Type"} |
| 354 | if long { |
| 355 | header = append(header, "Created At", "Updated At") |
| 356 | } |
| 357 | t.AppendHeader(header) |
| 358 | for _, val := range creds { |
| 359 | row := table.Row{val.ID, val.Name, val.Description, val.BaseURL, val.APIBaseURL, val.UploadBaseURL, val.AuthType} |
| 360 | if long { |
| 361 | row = append(row, val.CreatedAt, val.UpdatedAt) |
| 362 | } |
| 363 | t.AppendRow(row) |
| 364 | t.AppendSeparator() |
| 365 | } |
| 366 | fmt.Println(t.Render()) |
| 367 | } |
| 368 | |
| 369 | func formatOneGithubCredential(cred params.ForgeCredentials) { |
| 370 | if outputFormat == common.OutputFormatJSON { |
no test coverage detected