MCPcopy Create free account
hub / github.com/dropbox/dbxcli / structuredOutputCommandPaths

Function structuredOutputCommandPaths

cmd/json_contract_test.go:1292–1309  ·  view source on GitHub ↗
(root *cobra.Command)

Source from the content-addressed store, hash-verified

1290}
1291
1292func structuredOutputCommandPaths(root *cobra.Command) []string {
1293 var paths []string
1294 var walk func(*cobra.Command, []string)
1295 walk = func(cmd *cobra.Command, parents []string) {
1296 parts := parents
1297 if cmd != root {
1298 parts = append(append([]string{}, parents...), cmd.Name())
1299 if commandSupportsStructuredOutput(cmd) {
1300 paths = append(paths, strings.Join(parts, " "))
1301 }
1302 }
1303 for _, child := range cmd.Commands() {
1304 walk(child, parts)
1305 }
1306 }
1307 walk(root, nil)
1308 return paths
1309}
1310
1311func TestJSONOperationOutputContractShape(t *testing.T) {
1312 encoded, err := json.Marshal(newJSONOperationOutput(nil, nil, nil))

Calls 1

Tested by

no test coverage detected