MCPcopy Index your code
hub / github.com/docker/docker-agent / renderTable

Method renderTable

cmd/root/models.go:373–384  ·  view source on GitHub ↗
(cmd *cobra.Command, rows []modelRow)

Source from the content-addressed store, hash-verified

371}
372
373func (f *modelsListFlags) renderTable(cmd *cobra.Command, rows []modelRow) {
374 w := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 2, 3, ' ', 0)
375 fmt.Fprintln(w, "PROVIDER\tMODEL\tDEFAULT")
376 for _, r := range rows {
377 def := ""
378 if r.Default {
379 def = "*"
380 }
381 fmt.Fprintf(w, "%s\t%s\t%s\n", r.Provider, r.Model, def)
382 }
383 w.Flush()
384}
385
386func (f *modelsListFlags) renderJSON(cmd *cobra.Command, rows []modelRow) error {
387 enc := json.NewEncoder(cmd.OutOrStdout())

Callers 1

runModelsListCommandMethod · 0.95

Calls 1

FlushMethod · 0.80

Tested by

no test coverage detected