Function
extractVisibleCommandPaths
(cmdPath []string, cmds []*serpent.Command)
Source from the content-addressed store, hash-verified
| 234 | } |
| 235 | |
| 236 | func 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 | |
| 249 | func prepareTestData(t *testing.T) (*codersdk.Client, map[string]string) { |
| 250 | t.Helper() |