(cmd *cobra.Command)
| 45 | } |
| 46 | |
| 47 | func telemetryFlags(cmd *cobra.Command) string { |
| 48 | var flags []string |
| 49 | cmd.Flags().Visit(func(f *pflag.Flag) { |
| 50 | flags = append(flags, f.Name) |
| 51 | }) |
| 52 | slices.Sort(flags) |
| 53 | return strings.Join(flags, ",") |
| 54 | } |
| 55 | |
| 56 | // RecordTelemetryForSubcommands instruments all descendants of a command. |
| 57 | func RecordTelemetryForSubcommands(cmd *cobra.Command, telemetry ghtelemetry.EventRecorder) { |