(cmd *cobra.Command)
| 263 | } |
| 264 | |
| 265 | func (fc *FuncCommand) Help(cmd *cobra.Command) error { |
| 266 | var args []any |
| 267 | // We need to store these in annotations because during traversal all |
| 268 | // sub-commands are created, not just the one selected. At the end of |
| 269 | // traversal we'll get the final command, but without the associated |
| 270 | // function or object type definitions. |
| 271 | if skipped, ok := cmd.Annotations[skippedOptsAnnotation]; ok { |
| 272 | args = append(args, "arguments", strings.Split(skipped, ", ")) |
| 273 | } |
| 274 | if skipped, ok := cmd.Annotations[skippedCmdsAnnotation]; ok { |
| 275 | args = append(args, "functions", strings.Split(skipped, ", ")) |
| 276 | } |
| 277 | if len(args) > 0 { |
| 278 | msg := "Skipped unsupported types" |
| 279 | if fc.warnSkipped { |
| 280 | slog.Warn(msg, args...) |
| 281 | } else { |
| 282 | slog.Debug(msg, args...) |
| 283 | } |
| 284 | } |
| 285 | return cmd.Help() |
| 286 | } |
| 287 | |
| 288 | // execute runs the main logic for the top level command's RunE function. |
| 289 | func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) { |
no test coverage detected