Skip to content

Commit

Permalink
Move registry update commands under setting
Browse files Browse the repository at this point in the history
This moves `buf registry module update` and `buf registry plugin update`
commands to `buf registry module setting update` and `buf registry
plugin setting update`, respectively. The command `buf registry module
update` is marked deprecated. The command `buf registry plugin update`
is removed as it was not yet released.
  • Loading branch information
emcfarlane committed Dec 10, 2024
1 parent 94d94d4 commit 5da7a03
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
21 changes: 17 additions & 4 deletions private/buf/cmd/buf/buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ import (
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelinfo"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabellist"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelunarchive"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleundeprecate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleupdate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationcreate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationdelete"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationinfo"
Expand All @@ -95,7 +95,7 @@ import (
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelinfo"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabellist"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelunarchive"
registrypluginupdate "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginupdate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrycc"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout"
Expand Down Expand Up @@ -268,12 +268,19 @@ func NewRootCommand(name string) *appcmd.Command {
modulelabelunarchive.NewCommand("unarchive", builder, ""),
},
},
{
Use: "setting",
Short: "Manage a module's settings",
SubCommands: []*appcmd.Command{
modulesettingupdate.NewCommand("update", builder, ""),
},
},
modulecreate.NewCommand("create", builder),
moduleinfo.NewCommand("info", builder),
moduledelete.NewCommand("delete", builder),
moduledeprecate.NewCommand("deprecate", builder),
modulesettingupdate.NewCommand("update", builder, deprecatedMessage("buf registry module setting update", "buf registry update")),
moduleundeprecate.NewCommand("undeprecate", builder),
moduleupdate.NewCommand("update", builder),
},
},
{
Expand All @@ -300,10 +307,16 @@ func NewRootCommand(name string) *appcmd.Command {
pluginlabelunarchive.NewCommand("unarchive", builder, ""),
},
},
{
Use: "setting",
Short: "Manage a plugin's settings",
SubCommands: []*appcmd.Command{
pluginsettingupdate.NewCommand("update", builder),
},
},
plugincreate.NewCommand("create", builder),
plugininfo.NewCommand("info", builder),
plugindelete.NewCommand("delete", builder),
registrypluginupdate.NewCommand("update", builder),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package moduleupdate
package modulesettingupdate

import (
"context"
Expand All @@ -37,12 +37,17 @@ const (
)

// NewCommand returns a new Command
func NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {
func NewCommand(
name string,
builder appext.SubCommandBuilder,
deprecated string,
) *appcmd.Command {
flags := newFlags()
return &appcmd.Command{
Use: name + " <remote/owner/module>",
Short: "Update BSR module settings",
Args: appcmd.ExactArgs(1),
Use: name + " <remote/owner/module>",
Short: "Update BSR module settings",
Args: appcmd.ExactArgs(1),
Deprecated: deprecated,
Run: builder.NewRunFunc(
func(ctx context.Context, container appext.Container) error {
return run(ctx, container, flags)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package pluginupdate
package pluginsettingupdate

import (
"context"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5da7a03

Please sign in to comment.