(rootCmd *cobra.Command, cmd *cobra.Command)
| 492 | } |
| 493 | |
| 494 | func canonicalCommandKey(rootCmd *cobra.Command, cmd *cobra.Command) string { |
| 495 | if cmd == nil { |
| 496 | return "" |
| 497 | } |
| 498 | path := cmd.CommandPath() |
| 499 | rootName := rootCmd.Name() |
| 500 | if path == rootName { |
| 501 | return "" |
| 502 | } |
| 503 | return strings.TrimPrefix(path, rootName+" ") |
| 504 | } |
| 505 | |
| 506 | type shellArgFlags struct { |
| 507 | hasPath bool |
no outgoing calls
no test coverage detected