@@ -63,18 +63,18 @@ import (
6363 "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules"
6464 "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen"
6565 "github.com/bufbuild/buf/private/buf/cmd/buf/command/push"
66- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/commit/commitaddlabel"
67- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/commit/commitinfo"
68- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/commit/commitlist"
69- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/commit/commitresolve"
70- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/label/labelarchive"
71- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/label/labelinfo"
72- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/label/labellist"
73- "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/label/labelunarchive"
66+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecommit/modulecommitaddlabel"
67+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecommit/modulecommitinfo"
68+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecommit/modulecommitlist"
69+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecommit/modulecommitresolve"
7470 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecreate"
7571 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduledelete"
7672 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduledeprecate"
7773 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleinfo"
74+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelarchive"
75+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelinfo"
76+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabellist"
77+ "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelunarchive"
7878 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleundeprecate"
7979 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleupdate"
8080 "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationcreate"
@@ -151,20 +151,20 @@ func NewRootCommand(name string) *appcmd.Command {
151151 },
152152 {
153153 Use : "mod" ,
154- Short : `Manage Buf modules. All commands are deprecated and have moved to the "buf config", "buf dep", or "buf registry" subcommands.` ,
155- Deprecated : `All commands are deprecated and have moved to the "buf config", "buf dep", or "buf registry" subcommands.` ,
154+ Short : `Manage Buf modules, all commands are deprecated and have moved to the "buf config", "buf dep", or "buf registry" subcommands.` ,
155+ Deprecated : `all commands are deprecated and have moved to the "buf config", "buf dep", or "buf registry" subcommands.` ,
156156 Hidden : true ,
157157 SubCommands : []* appcmd.Command {
158158 // Deprecated and hidden.
159- configinit .NewCommand ("init" , builder , `use "buf config init" instead. However , "buf mod init" will continue to work.` , true , true ),
159+ configinit .NewCommand ("init" , builder , deprecatedMessage ( "buf config init" , "buf mod init" ) , true , true ),
160160 // Deprecated and hidden.
161- depprune .NewCommand ("prune" , builder , `use "buf dep prune" instead. However , "buf mod update" will continue to work.` , true ),
161+ depprune .NewCommand ("prune" , builder , deprecatedMessage ( "buf dep prune" , "buf mod update" ) , true ),
162162 // Deprecated and hidden.
163- depupdate .NewCommand ("update" , builder , `use "buf dep update" instead. However , "buf mod update" will continue to work.` , true ),
163+ depupdate .NewCommand ("update" , builder , deprecatedMessage ( "buf dep update" , "buf mod update" ) , true ),
164164 // Deprecated and hidden.
165165 modopen .NewCommand ("open" , builder ),
166166 // Deprecated and hidden.
167- registrycc .NewCommand ("clear-cache" , builder , `use "buf registry cc" instead. However , "buf mod clear-cache" will continue to work.` , true , "cc" ),
167+ registrycc .NewCommand ("clear-cache" , builder , deprecatedMessage ( "buf registry cc" , "buf mod clear-cache" ) , true , "cc" ),
168168 // Deprecated and hidden.
169169 modlslintrules .NewCommand ("ls-lint-rules" , builder ),
170170 // Deprecated and hidden.
@@ -180,13 +180,15 @@ func NewRootCommand(name string) *appcmd.Command {
180180 whoami .NewCommand ("whoami" , builder ),
181181 registrycc .NewCommand ("cc" , builder , `` , false ),
182182 {
183- Use : "commit" ,
184- Short : "Manage a repository's commits" ,
183+ Use : "commit" ,
184+ Short : `Manage a module's commits, all commands are deprecated and have moved to the "buf registry module commit" subcommands` ,
185+ Deprecated : `all commands are deprecated and have moved to the "buf registry module commit" subcommands.` ,
186+ Hidden : true ,
185187 SubCommands : []* appcmd.Command {
186- commitaddlabel .NewCommand ("add-label" , builder ),
187- commitinfo .NewCommand ("info" , builder ),
188- commitlist .NewCommand ("list" , builder ),
189- commitresolve .NewCommand ("resolve" , builder ),
188+ modulecommitaddlabel .NewCommand ("add-label" , builder , deprecatedMessage ( "buf registry module commit add-label" , "buf registry commit add-label" ) ),
189+ modulecommitinfo .NewCommand ("info" , builder , deprecatedMessage ( "buf registry module commit info" , "buf registry commit info" ) ),
190+ modulecommitlist .NewCommand ("list" , builder , deprecatedMessage ( "buf registry module commit list" , "buf registry commit list" ) ),
191+ modulecommitresolve .NewCommand ("resolve" , builder , deprecatedMessage ( "buf registry module commit resolve" , "buf registry commit resolve" ) ),
190192 },
191193 },
192194 {
@@ -197,13 +199,15 @@ func NewRootCommand(name string) *appcmd.Command {
197199 },
198200 },
199201 {
200- Use : "label" ,
201- Short : "Manage a module's labels" ,
202+ Use : "label" ,
203+ Short : `Manage a module's labels, all commands are deprecated and have moved to the "buf registry module label" subcommands` ,
204+ Deprecated : `all commands are deprecated and have moved to the "buf registry module label" subcommands.` ,
205+ Hidden : true ,
202206 SubCommands : []* appcmd.Command {
203- labelarchive .NewCommand ("archive" , builder ),
204- labelinfo .NewCommand ("info" , builder ),
205- labellist .NewCommand ("list" , builder ),
206- labelunarchive .NewCommand ("unarchive" , builder ),
207+ modulelabelarchive .NewCommand ("archive" , builder , deprecatedMessage ( "buf registry module label archive" , "buf registry label archive" ) ),
208+ modulelabelinfo .NewCommand ("info" , builder , deprecatedMessage ( "buf registry module label info" , "buf registry label info" ) ),
209+ modulelabellist .NewCommand ("list" , builder , deprecatedMessage ( "buf registry module label list" , "buf registry label list" ) ),
210+ modulelabelunarchive .NewCommand ("unarchive" , builder , deprecatedMessage ( "buf registry module label unarchive" , "buf registry label unarchive" ) ),
207211 },
208212 },
209213 {
@@ -220,6 +224,26 @@ func NewRootCommand(name string) *appcmd.Command {
220224 Use : "module" ,
221225 Short : "Manage BSR modules" ,
222226 SubCommands : []* appcmd.Command {
227+ {
228+ Use : "commit" ,
229+ Short : "Manage a module's commits" ,
230+ SubCommands : []* appcmd.Command {
231+ modulecommitaddlabel .NewCommand ("add-label" , builder , "" ),
232+ modulecommitinfo .NewCommand ("info" , builder , "" ),
233+ modulecommitlist .NewCommand ("list" , builder , "" ),
234+ modulecommitresolve .NewCommand ("resolve" , builder , "" ),
235+ },
236+ },
237+ {
238+ Use : "label" ,
239+ Short : "Manage a module's labels" ,
240+ SubCommands : []* appcmd.Command {
241+ modulelabelarchive .NewCommand ("archive" , builder , "" ),
242+ modulelabelinfo .NewCommand ("info" , builder , "" ),
243+ modulelabellist .NewCommand ("list" , builder , "" ),
244+ modulelabelunarchive .NewCommand ("unarchive" , builder , "" ),
245+ },
246+ },
223247 modulecreate .NewCommand ("create" , builder ),
224248 moduleinfo .NewCommand ("info" , builder ),
225249 moduledelete .NewCommand ("delete" , builder ),
@@ -458,3 +482,11 @@ func isPossibleNewCLIOldBSRError(connectErr *connect.Error) bool {
458482 return false
459483 }
460484}
485+
486+ // deprecatedMessage returns a message indicating that a command is deprecated.
487+ func deprecatedMessage (newCommand , oldCommand string ) string {
488+ return fmt .Sprintf (
489+ `use "%s" instead. However, "%s" will continue to work.` ,
490+ newCommand , oldCommand ,
491+ )
492+ }
0 commit comments