MCPcopy Create free account
hub / github.com/bufbuild/buf / NewCommand

Function NewCommand

cmd/buf/internal/command/plugin/pluginprune/pluginprune.go:30–48  ·  view source on GitHub ↗

NewCommand returns a new Command.

(
	name string,
	builder appext.SubCommandBuilder,
)

Source from the content-addressed store, hash-verified

28
29// NewCommand returns a new Command.
30func NewCommand(
31 name string,
32 builder appext.SubCommandBuilder,
33) *appcmd.Command {
34 return &appcmd.Command{
35 Use: name + " <directory>",
36 Short: "Prune unused plugins from buf.lock",
37 Long: `Plugins that are no longer configured in buf.yaml are removed from the buf.lock file.
38
39The first argument is the directory of your buf.yaml configuration file.
40Defaults to "." if no argument is specified.`,
41 Args: appcmd.MaximumNArgs(1),
42 Run: builder.NewRunFunc(
43 func(ctx context.Context, container appext.Container) error {
44 return run(ctx, container)
45 },
46 ),
47 }
48}
49
50func run(
51 ctx context.Context,

Callers 1

newRootCommandFunction · 0.92

Calls 1

runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…