@@ -33,22 +33,29 @@ type pruneOptions struct {
3333}
3434
3535// NewPruneCommand returns a new cobra prune command for images
36+ //
37+ // Deprecated: Do not import commands directly. They will be removed in a future release.
3638func NewPruneCommand (dockerCli command.Cli ) * cobra.Command {
39+ return newPruneCommand (dockerCli )
40+ }
41+
42+ // newPruneCommand returns a new cobra prune command for images
43+ func newPruneCommand (dockerCLI command.Cli ) * cobra.Command {
3744 options := pruneOptions {filter : opts .NewFilterOpt ()}
3845
3946 cmd := & cobra.Command {
4047 Use : "prune" ,
4148 Short : "Remove build cache" ,
4249 Args : cli .NoArgs ,
4350 RunE : func (cmd * cobra.Command , args []string ) error {
44- spaceReclaimed , output , err := runPrune (cmd .Context (), dockerCli , options )
51+ spaceReclaimed , output , err := runPrune (cmd .Context (), dockerCLI , options )
4552 if err != nil {
4653 return err
4754 }
4855 if output != "" {
49- fmt .Fprintln (dockerCli .Out (), output )
56+ _ , _ = fmt .Fprintln (dockerCLI .Out (), output )
5057 }
51- fmt .Fprintln (dockerCli .Out (), "Total reclaimed space:" , units .HumanSize (float64 (spaceReclaimed )))
58+ _ , _ = fmt .Fprintln (dockerCLI .Out (), "Total reclaimed space:" , units .HumanSize (float64 (spaceReclaimed )))
5259 return nil
5360 },
5461 Annotations : map [string ]string {"version" : "1.39" },
0 commit comments