(cmd *cobra.Command, prefix string)
| 81 | } |
| 82 | |
| 83 | func collectSurface(cmd *cobra.Command, prefix string) []string { |
| 84 | var lines []string |
| 85 | |
| 86 | path := prefix + cmd.Name() |
| 87 | lines = append(lines, path) |
| 88 | |
| 89 | cmd.NonInheritedFlags().VisitAll(func(f *pflag.Flag) { |
| 90 | lines = append(lines, path+" --"+f.Name) |
| 91 | }) |
| 92 | |
| 93 | for _, sub := range cmd.Commands() { |
| 94 | if sub.Hidden || !sub.IsAvailableCommand() { |
| 95 | continue |
| 96 | } |
| 97 | lines = append(lines, collectSurface(sub, path+" ")...) |
| 98 | } |
| 99 | |
| 100 | return lines |
| 101 | } |
no outgoing calls
no test coverage detected