MCPcopy Create free account
hub / github.com/Facets-cloud/flow / emptyResult

Function emptyResult

internal/app/list.go:116–126  ·  view source on GitHub ↗

emptyResult prints the conventional "(no X)" line and returns 0. Honors the requested format: JSON emits "[]", TSV emits a header-only stream, table emits the human-friendly placeholder.

(format listfmt.Format, label string, tsvHeaders []string)

Source from the content-addressed store, hash-verified

114// the requested format: JSON emits "[]", TSV emits a header-only stream,
115// table emits the human-friendly placeholder.
116func emptyResult(format listfmt.Format, label string, tsvHeaders []string) int {
117 switch format {
118 case listfmt.FormatJSON:
119 return runJSON(os.Stdout, []any{})
120 case listfmt.FormatTSV:
121 _ = listfmt.RenderTSV(os.Stdout, tsvHeaders, nil)
122 default:
123 fmt.Printf("(no %s)\n", label)
124 }
125 return 0
126}
127
128func listTagsCmd(args []string) int {
129 fs := flagSet("list tags")

Callers 5

listTagsCmdFunction · 0.85
listTasksCmdFunction · 0.85
listProjectsCmdFunction · 0.85
listPlaybooksCmdFunction · 0.85
listRunsCmdFunction · 0.85

Calls 2

RenderTSVFunction · 0.92
runJSONFunction · 0.85

Tested by

no test coverage detected