(cmd *cobra.Command)
| 159 | } |
| 160 | |
| 161 | func jsonCommandPath(cmd *cobra.Command) string { |
| 162 | if cmd == nil { |
| 163 | return "" |
| 164 | } |
| 165 | if cmd.Parent() == nil { |
| 166 | return cmd.Name() |
| 167 | } |
| 168 | |
| 169 | var parts []string |
| 170 | for c := cmd; c != nil && c.Parent() != nil; c = c.Parent() { |
| 171 | if name := c.Name(); name != "" { |
| 172 | parts = append([]string{name}, parts...) |
| 173 | } |
| 174 | } |
| 175 | return strings.Join(parts, " ") |
| 176 | } |
no outgoing calls
no test coverage detected