diff --git a/cli/command/volume/prune.go b/cli/command/volume/prune.go index d2d249cdb3..a85cb38833 100644 --- a/cli/command/volume/prune.go +++ b/cli/command/volume/prune.go @@ -8,11 +8,15 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" "github.com/docker/cli/opts" + "github.com/docker/docker/api/types/versions" + "github.com/docker/docker/errdefs" units "github.com/docker/go-units" + "github.com/pkg/errors" "github.com/spf13/cobra" ) type pruneOptions struct { + all bool force bool filter opts.FilterOpt } @@ -41,18 +45,37 @@ func NewPruneCommand(dockerCli command.Cli) *cobra.Command { } flags := cmd.Flags() + flags.BoolVarP(&options.all, "all", "a", false, "Remove all unused volumes, not just anonymous ones") + flags.SetAnnotation("all", "version", []string{"1.42"}) flags.BoolVarP(&options.force, "force", "f", false, "Do not prompt for confirmation") flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=