NewCommand returns a new Command.
( name string, builder appext.SubCommandBuilder, )
| 28 | |
| 29 | // NewCommand returns a new Command. |
| 30 | func 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 | |
| 39 | The first argument is the directory of your buf.yaml configuration file. |
| 40 | Defaults 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 | |
| 50 | func run( |
| 51 | ctx context.Context, |
no test coverage detected
searching dependent graphs…