@@ -24,22 +24,29 @@ type pruneOptions struct {
2424}
2525
2626// NewPruneCommand returns a new cobra prune command for images
27+ //
28+ // Deprecated: Do not import commands directly. They will be removed in a future release.
2729func NewPruneCommand (dockerCli command.Cli ) * cobra.Command {
30+ return newPruneCommand (dockerCli )
31+ }
32+
33+ // newPruneCommand returns a new cobra prune command for images
34+ func newPruneCommand (dockerCLI command.Cli ) * cobra.Command {
2835 options := pruneOptions {filter : opts .NewFilterOpt ()}
2936
3037 cmd := & cobra.Command {
3138 Use : "prune" ,
3239 Short : "Remove build cache" ,
3340 Args : cli .NoArgs ,
3441 RunE : func (cmd * cobra.Command , args []string ) error {
35- spaceReclaimed , output , err := runPrune (cmd .Context (), dockerCli , options )
42+ spaceReclaimed , output , err := runPrune (cmd .Context (), dockerCLI , options )
3643 if err != nil {
3744 return err
3845 }
3946 if output != "" {
40- fmt .Fprintln (dockerCli .Out (), output )
47+ _ , _ = fmt .Fprintln (dockerCLI .Out (), output )
4148 }
42- fmt .Fprintln (dockerCli .Out (), "Total reclaimed space:" , units .HumanSize (float64 (spaceReclaimed )))
49+ _ , _ = fmt .Fprintln (dockerCLI .Out (), "Total reclaimed space:" , units .HumanSize (float64 (spaceReclaimed )))
4350 return nil
4451 },
4552 Annotations : map [string ]string {"version" : "1.39" },
0 commit comments