@@ -55,21 +55,21 @@ var (
5555 // them names for use on the command line.
5656 // Each output rule turns into two command line options:
5757 // - output:<generator>:<form> (per-generator output)
58- // - output:<form> (default output)
58+ // - output:<form> (default output).
5959 allOutputRules = map [string ]genall.OutputRule {
6060 "dir" : genall .OutputToDirectory ("" ),
6161 "none" : genall .OutputToNothing ,
6262 "stdout" : genall .OutputToStdout ,
6363 "artifacts" : genall.OutputArtifacts {},
6464 }
6565
66- // optionsRegistry contains all the marker definitions used to process command line options
66+ // optionsRegistry contains all the marker definitions used to process command line options.
6767 optionsRegistry = & markers.Registry {}
6868)
6969
7070func init () {
7171 for genName , gen := range allGenerators {
72- // make the generator options marker itself
72+ // make the generator options marker itself.
7373 defn := markers .Must (markers .MakeDefinition (genName , markers .DescribesPackage , gen ))
7474 if err := optionsRegistry .Register (defn ); err != nil {
7575 panic (err )
@@ -80,7 +80,7 @@ func init() {
8080 }
8181 }
8282
83- // make per-generation output rule markers
83+ // make per-generation output rule markers.
8484 for ruleName , rule := range allOutputRules {
8585 ruleMarker := markers .Must (markers .MakeDefinition (fmt .Sprintf ("output:%s:%s" , genName , ruleName ), markers .DescribesPackage , rule ))
8686 if err := optionsRegistry .Register (ruleMarker ); err != nil {
@@ -94,7 +94,7 @@ func init() {
9494 }
9595 }
9696
97- // make "default output" output rule markers
97+ // make "default output" output rule markers.
9898 for ruleName , rule := range allOutputRules {
9999 ruleMarker := markers .Must (markers .MakeDefinition ("output:" + ruleName , markers .DescribesPackage , rule ))
100100 if err := optionsRegistry .Register (ruleMarker ); err != nil {
@@ -107,7 +107,7 @@ func init() {
107107 }
108108 }
109109
110- // add in the common options markers
110+ // add in the common options markers.
111111 if err := genall .RegisterOptionsMarkers (optionsRegistry ); err != nil {
112112 panic (err )
113113 }
@@ -143,23 +143,23 @@ func main() {
143143 code-generator lister -ww
144144` ,
145145 RunE : func (c * cobra.Command , rawOpts []string ) error {
146- // print version if asked for it
146+ // print version if asked for it.
147147 if showVersion {
148148 version .Print ()
149149 return nil
150150 }
151151
152- // print the help if we asked for it (since we've got a different help flag :-/), then bail
152+ // print the help if we asked for it (since we've got a different help flag :-/), then bail.
153153 if helpLevel > 0 {
154154 return c .Usage ()
155155 }
156156
157- // print the marker docs if we asked for them, then bail
157+ // print the marker docs if we asked for them, then bail.
158158 if whichLevel > 0 {
159159 return printMarkerDocs (c , rawOpts , whichLevel )
160160 }
161161
162- // otherwise, set up the runtime for actually running the generators
162+ // otherwise, set up the runtime for actually running the generators.
163163 rt , err := genall .FromOptions (optionsRegistry , rawOpts )
164164 if err != nil {
165165 return err
@@ -174,7 +174,7 @@ func main() {
174174 }
175175 return nil
176176 },
177- SilenceUsage : true , // silence the usage, then print it out ourselves if it wasn't suppressed
177+ SilenceUsage : true , // silence the usage, then print it out ourselves if it wasn't suppressed.
178178 }
179179 cmd .Flags ().CountVarP (& whichLevel , "which-markers" , "w" , "print out all markers available with the requested generators\n (up to -www for the most detailed output, or -wwww for json output)" )
180180 cmd .Flags ().CountVarP (& helpLevel , "detailed-help" , "h" , "print out more detailed help\n (up to -hhh for the most detailed output, or -hhhh for json output)" )
@@ -194,7 +194,7 @@ func main() {
194194
195195 if err := cmd .Execute (); err != nil {
196196 if _ , noUsage := err .(noUsageError ); ! noUsage {
197- // print the usage unless we suppressed it
197+ // print the usage unless we suppressed it.
198198 if err := cmd .Usage (); err != nil {
199199 panic (err )
200200 }
0 commit comments