@@ -30,7 +30,7 @@ import (
3030 "github.com/containerd/nerdctl/v2/pkg/cmd/builder"
3131)
3232
33- func NewBuilderCommand () * cobra.Command {
33+ func Command () * cobra.Command {
3434 var cmd = & cobra.Command {
3535 Annotations : map [string ]string {helpers .Category : helpers .Management },
3636 Use : "builder" ,
@@ -40,20 +40,20 @@ func NewBuilderCommand() *cobra.Command {
4040 SilenceErrors : true ,
4141 }
4242 cmd .AddCommand (
43- NewBuildCommand (),
44- newBuilderPruneCommand (),
45- newBuilderDebugCommand (),
43+ BuildCommand (),
44+ pruneCommand (),
45+ debugCommand (),
4646 )
4747 return cmd
4848}
4949
50- func newBuilderPruneCommand () * cobra.Command {
50+ func pruneCommand () * cobra.Command {
5151 shortHelp := `Clean up BuildKit build cache`
5252 var cmd = & cobra.Command {
5353 Use : "prune" ,
5454 Args : cobra .NoArgs ,
5555 Short : shortHelp ,
56- RunE : builderPruneAction ,
56+ RunE : pruneAction ,
5757 SilenceUsage : true ,
5858 SilenceErrors : true ,
5959 }
@@ -65,8 +65,8 @@ func newBuilderPruneCommand() *cobra.Command {
6565 return cmd
6666}
6767
68- func builderPruneAction (cmd * cobra.Command , _ []string ) error {
69- options , err := processBuilderPruneOptions (cmd )
68+ func pruneAction (cmd * cobra.Command , _ []string ) error {
69+ options , err := pruneOptions (cmd )
7070 if err != nil {
7171 return err
7272 }
@@ -101,7 +101,7 @@ func builderPruneAction(cmd *cobra.Command, _ []string) error {
101101 return nil
102102}
103103
104- func processBuilderPruneOptions (cmd * cobra.Command ) (types.BuilderPruneOptions , error ) {
104+ func pruneOptions (cmd * cobra.Command ) (types.BuilderPruneOptions , error ) {
105105 globalOptions , err := helpers .ProcessRootCmdFlags (cmd )
106106 if err != nil {
107107 return types.BuilderPruneOptions {}, err
@@ -131,13 +131,13 @@ func processBuilderPruneOptions(cmd *cobra.Command) (types.BuilderPruneOptions,
131131 }, nil
132132}
133133
134- func newBuilderDebugCommand () * cobra.Command {
134+ func debugCommand () * cobra.Command {
135135 shortHelp := `Debug Dockerfile`
136136 var cmd = & cobra.Command {
137137 Use : "debug" ,
138138 Short : shortHelp ,
139139 PreRunE : helpers .CheckExperimental ("`nerdctl builder debug`" ),
140- RunE : builderDebugAction ,
140+ RunE : debugAction ,
141141 SilenceUsage : true ,
142142 SilenceErrors : true ,
143143 }
@@ -150,7 +150,7 @@ func newBuilderDebugCommand() *cobra.Command {
150150 return cmd
151151}
152152
153- func builderDebugAction (cmd * cobra.Command , args []string ) error {
153+ func debugAction (cmd * cobra.Command , args []string ) error {
154154 globalOptions , err := helpers .ProcessRootCmdFlags (cmd )
155155 if err != nil {
156156 return err
0 commit comments