@@ -63,18 +63,18 @@ import (
63
63
"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules"
64
64
"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen"
65
65
"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"
74
70
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulecreate"
75
71
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduledelete"
76
72
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduledeprecate"
77
73
"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"
78
78
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleundeprecate"
79
79
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleupdate"
80
80
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationcreate"
@@ -151,20 +151,20 @@ func NewRootCommand(name string) *appcmd.Command {
151
151
},
152
152
{
153
153
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.` ,
156
156
Hidden : true ,
157
157
SubCommands : []* appcmd.Command {
158
158
// 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 ),
160
160
// 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 ),
162
162
// 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 ),
164
164
// Deprecated and hidden.
165
165
modopen .NewCommand ("open" , builder ),
166
166
// 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" ),
168
168
// Deprecated and hidden.
169
169
modlslintrules .NewCommand ("ls-lint-rules" , builder ),
170
170
// Deprecated and hidden.
@@ -180,13 +180,15 @@ func NewRootCommand(name string) *appcmd.Command {
180
180
whoami .NewCommand ("whoami" , builder ),
181
181
registrycc .NewCommand ("cc" , builder , `` , false ),
182
182
{
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 ,
185
187
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" ) ),
190
192
},
191
193
},
192
194
{
@@ -197,13 +199,15 @@ func NewRootCommand(name string) *appcmd.Command {
197
199
},
198
200
},
199
201
{
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 ,
202
206
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" ) ),
207
211
},
208
212
},
209
213
{
@@ -220,6 +224,26 @@ func NewRootCommand(name string) *appcmd.Command {
220
224
Use : "module" ,
221
225
Short : "Manage BSR modules" ,
222
226
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
+ },
223
247
modulecreate .NewCommand ("create" , builder ),
224
248
moduleinfo .NewCommand ("info" , builder ),
225
249
moduledelete .NewCommand ("delete" , builder ),
@@ -458,3 +482,11 @@ func isPossibleNewCLIOldBSRError(connectErr *connect.Error) bool {
458
482
return false
459
483
}
460
484
}
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