summaryrefslogtreecommitdiff
path: root/cmd/podman/images.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-03-02 07:14:28 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2019-03-03 06:14:20 -0500
commitd231cfba92ef440404f936a2cb0a64503b9c8c46 (patch)
tree716b5088d5f97ee85dc0adf19e43622044a41b5d /cmd/podman/images.go
parent4c618875f6402f36e4c820766050667e6a417d7c (diff)
downloadpodman-d231cfba92ef440404f936a2cb0a64503b9c8c46.tar.gz
podman-d231cfba92ef440404f936a2cb0a64503b9c8c46.tar.bz2
podman-d231cfba92ef440404f936a2cb0a64503b9c8c46.zip
Fix aliased commands to actually work
The current aliased commands podman container list and podman image list podman image rm Do not work properly. The global storage options are broken. This patch fixes this issue. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images.go')
-rw-r--r--cmd/podman/images.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/cmd/podman/images.go b/cmd/podman/images.go
index e6f4d9a60..26e51bef7 100644
--- a/cmd/podman/images.go
+++ b/cmd/podman/images.go
@@ -102,22 +102,26 @@ var (
}
)
-func init() {
- imagesCommand.Command = &_imagesCommand
- imagesCommand.SetUsageTemplate(UsageTemplate())
-
- flags := imagesCommand.Flags()
- flags.BoolVarP(&imagesCommand.All, "all", "a", false, "Show all images (default hides intermediate images)")
- flags.BoolVar(&imagesCommand.Digests, "digests", false, "Show digests")
- flags.StringSliceVarP(&imagesCommand.Filter, "filter", "f", []string{}, "Filter output based on conditions provided (default [])")
- flags.StringVar(&imagesCommand.Format, "format", "", "Change the output format to JSON or a Go template")
- flags.BoolVarP(&imagesCommand.Noheading, "noheading", "n", false, "Do not print column headings")
+func imagesInit(command *cliconfig.ImagesValues) {
+ command.SetUsageTemplate(UsageTemplate())
+
+ flags := command.Flags()
+ flags.BoolVarP(&command.All, "all", "a", false, "Show all images (default hides intermediate images)")
+ flags.BoolVar(&command.Digests, "digests", false, "Show digests")
+ flags.StringSliceVarP(&command.Filter, "filter", "f", []string{}, "Filter output based on conditions provided (default [])")
+ flags.StringVar(&command.Format, "format", "", "Change the output format to JSON or a Go template")
+ flags.BoolVarP(&command.Noheading, "noheading", "n", false, "Do not print column headings")
// TODO Need to learn how to deal with second name being a string instead of a char.
// This needs to be "no-trunc, notruncate"
- flags.BoolVar(&imagesCommand.NoTrunc, "no-trunc", false, "Do not truncate output")
- flags.BoolVarP(&imagesCommand.Quiet, "quiet", "q", false, "Display only image IDs")
- flags.StringVar(&imagesCommand.Sort, "sort", "created", "Sort by created, id, repository, size, or tag")
+ flags.BoolVar(&command.NoTrunc, "no-trunc", false, "Do not truncate output")
+ flags.BoolVarP(&command.Quiet, "quiet", "q", false, "Display only image IDs")
+ flags.StringVar(&command.Sort, "sort", "created", "Sort by created, id, repository, size, or tag")
+
+}
+func init() {
+ imagesCommand.Command = &_imagesCommand
+ imagesInit(&imagesCommand)
}
func imagesCmd(c *cliconfig.ImagesValues) error {