code: func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator) {
  	// Iterate over all generators and mark any flags used by them.
  	for name, generator := range generators {
  		generatorParams := map[string]struct{}{}
  		for _, param := range generator.ParamNames() {
  			generatorParams[param.Name] = struct{}{}
  		}
  
  		cmd.Flags().VisitAll(func(flag *pflag.Flag) {
  			if _, found := generatorParams[flag.Name]; !found {
  				// This flag is not used by the current generator
  				// so skip it.
  				return
  			}
  			if flag.Annotations == nil {
  				flag.Annotations = map[string][]string{}
  			}
  			if annotations := flag.Annotations["generator"]; annotations == nil {
  				flag.Annotations["generator"] = []string{}
  			}
  			flag.Annotations["generator"] = append(flag.Annotations["generator"], name)
  		})
  	}
  }
docs: // AnnotateFlags annotates all flags that are used by generators.