summaryrefslogtreecommitdiff
path: root/cmd/podman/images/prune.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/images/prune.go')
-rw-r--r--cmd/podman/images/prune.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go
index 8231e5c57..db645cc2e 100644
--- a/cmd/podman/images/prune.go
+++ b/cmd/podman/images/prune.go
@@ -7,6 +7,7 @@ import (
"strings"
"github.com/containers/common/pkg/completion"
+ "github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/utils"
"github.com/containers/podman/v3/cmd/podman/validate"
@@ -15,10 +16,8 @@ import (
)
var (
- pruneDescription = `Removes all unnamed images from local storage.
-
- If an image is not being used by a container, it will be removed from the system.`
- pruneCmd = &cobra.Command{
+ pruneDescription = `Removes dangling or unused images from local storage.`
+ pruneCmd = &cobra.Command{
Use: "prune [options]",
Args: validate.NoArgs,
Short: "Remove unused images",
@@ -41,13 +40,12 @@ func init() {
})
flags := pruneCmd.Flags()
- flags.BoolVarP(&pruneOpts.All, "all", "a", false, "Remove all unused images, not just dangling ones")
+ flags.BoolVarP(&pruneOpts.All, "all", "a", false, "Remove all images not in use by containers, not just dangling ones")
flags.BoolVarP(&force, "force", "f", false, "Do not prompt for confirmation")
filterFlagName := "filter"
flags.StringArrayVar(&filter, filterFlagName, []string{}, "Provide filter values (e.g. 'label=<key>=<value>')")
- //TODO: add completion for filters
- _ = pruneCmd.RegisterFlagCompletionFunc(filterFlagName, completion.AutocompleteNone)
+ _ = pruneCmd.RegisterFlagCompletionFunc(filterFlagName, common.AutocompletePruneFilters)
}
func prune(cmd *cobra.Command, args []string) error {