(cmd *cobra.Command, key string)
| 513 | } |
| 514 | |
| 515 | func commandAnnotationList(cmd *cobra.Command, key string) []string { |
| 516 | if cmd == nil || cmd.Annotations == nil { |
| 517 | return nil |
| 518 | } |
| 519 | value, ok := cmd.Annotations[key] |
| 520 | if !ok { |
| 521 | return nil |
| 522 | } |
| 523 | if value == "" { |
| 524 | return []string{} |
| 525 | } |
| 526 | parts := strings.Split(value, ",") |
| 527 | result := make([]string, 0, len(parts)) |
| 528 | for _, part := range parts { |
| 529 | part = strings.TrimSpace(part) |
| 530 | if part != "" { |
| 531 | result = append(result, part) |
| 532 | } |
| 533 | } |
| 534 | sort.Strings(result) |
| 535 | return result |
| 536 | } |
| 537 | |
| 538 | func isNoAuthCommand(cmd *cobra.Command) bool { |
| 539 | switch cmd.Name() { |
no outgoing calls
no test coverage detected