(cmdPath []string, cmds []*serpent.Command)
| 71 | } |
| 72 | |
| 73 | func extractCommandPaths(cmdPath []string, cmds []*serpent.Command) [][]string { |
| 74 | var cmdPaths [][]string |
| 75 | for _, c := range cmds { |
| 76 | cmdPath := append(cmdPath, c.Name()) |
| 77 | cmdPaths = append(cmdPaths, cmdPath) |
| 78 | cmdPaths = append(cmdPaths, extractCommandPaths(cmdPath, c.Children)...) |
| 79 | } |
| 80 | return cmdPaths |
| 81 | } |
| 82 | |
| 83 | // Must return a fresh instance of cmds each time. |
| 84 | func getRoot(t *testing.T) *serpent.Command { |
no test coverage detected