MCPcopy Index your code
hub / github.com/coder/coder / extractVisibleCommandPaths

Function extractVisibleCommandPaths

cli/clitest/golden.go:236–247  ·  view source on GitHub ↗
(cmdPath []string, cmds []*serpent.Command)

Source from the content-addressed store, hash-verified

234}
235
236func extractVisibleCommandPaths(cmdPath []string, cmds []*serpent.Command) [][]string {
237 var cmdPaths [][]string
238 for _, c := range cmds {
239 if c.Hidden {
240 continue
241 }
242 cmdPath := append(cmdPath, c.Name())
243 cmdPaths = append(cmdPaths, cmdPath)
244 cmdPaths = append(cmdPaths, extractVisibleCommandPaths(cmdPath, c.Children)...)
245 }
246 return cmdPaths
247}
248
249func prepareTestData(t *testing.T) (*codersdk.Client, map[string]string) {
250 t.Helper()

Callers 1

TestCommandHelpFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by 1

TestCommandHelpFunction · 0.68