summaryrefslogtreecommitdiff
path: root/cmd/podman/images.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-06-14 15:29:46 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-19 14:45:29 +0000
commit4ab054073dadf5257bdd0ff21e154b859e139f1e (patch)
tree73cc17e44047506e8d548b8625346400899af0f1 /cmd/podman/images.go
parentdfd34b1b03d3ec0447fb04e15b2d0861a4a9778d (diff)
downloadpodman-4ab054073dadf5257bdd0ff21e154b859e139f1e.tar.gz
podman-4ab054073dadf5257bdd0ff21e154b859e139f1e.tar.bz2
podman-4ab054073dadf5257bdd0ff21e154b859e139f1e.zip
Added --sort to ps
Also podman ps now allows user to only output size of root FS, changed language of images and ps --sort to be by "created" as opposed to "time", and refactored the way templates are created (converted from psJSONParams type). Signed-off-by: haircommander <pehunt@redhat.com> Closes: #948 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/images.go')
-rw-r--r--cmd/podman/images.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/podman/images.go b/cmd/podman/images.go
index 654e59845..fdf2eb02c 100644
--- a/cmd/podman/images.go
+++ b/cmd/podman/images.go
@@ -53,9 +53,9 @@ type imagesSorted []imagesTemplateParams
func (a imagesSorted) Len() int { return len(a) }
func (a imagesSorted) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
-type imagesSortedTime struct{ imagesSorted }
+type imagesSortedCreated struct{ imagesSorted }
-func (a imagesSortedTime) Less(i, j int) bool {
+func (a imagesSortedCreated) Less(i, j int) bool {
return a.imagesSorted[i].CreatedTime.After(a.imagesSorted[j].CreatedTime)
}
@@ -113,8 +113,8 @@ var (
},
cli.StringFlag{
Name: "sort",
- Usage: "Sort by size, time, id, repository or tag",
- Value: "time",
+ Usage: "Sort by created, id, repository, size, or tag",
+ Value: "created",
},
}
@@ -252,8 +252,8 @@ func sortImagesOutput(sortBy string, imagesOutput imagesSorted) imagesSorted {
case "repository":
sort.Sort(imagesSortedRepository{imagesOutput})
default:
- // default is time
- sort.Sort(imagesSortedTime{imagesOutput})
+ // default is created time
+ sort.Sort(imagesSortedCreated{imagesOutput})
}
return imagesOutput
}