From b9a39e46dec137a826beb1e4f815c98ebbb22594 Mon Sep 17 00:00:00 2001 From: Abhilash Gnan Date: Tue, 2 Apr 2019 22:40:31 +0200 Subject: [PATCH] handle default list sort order through enum order Signed-off-by: Abhilash Gnan --- pkg/action/list.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/action/list.go b/pkg/action/list.go index 9e2e5258a..f423c2343 100644 --- a/pkg/action/list.go +++ b/pkg/action/list.go @@ -87,14 +87,14 @@ const ListAll = ListDeployed | ListUninstalled | ListUninstalling | ListPendingI type Sorter uint const ( - // ByDateAsc sorts by ascending dates (oldest updated release first) - ByDateAsc Sorter = iota - // ByDateDesc sorts by descending dates (latest updated release first) - ByDateDesc // ByNameAsc sorts by ascending lexicographic order - ByNameAsc + ByNameAsc Sorter = iota // ByNameDesc sorts by descending lexicographic order ByNameDesc + // ByDateAsc sorts by ascending dates (oldest updated release first) + ByDateAsc + // ByDateDesc sorts by descending dates (latest updated release first) + ByDateDesc ) // List is the action for listing releases. @@ -197,7 +197,6 @@ func (l *List) Run() ([]*release.Release, error) { // sort is an in-place sort where order is based on the value of a.Sort func (l *List) sort(rels []*release.Release) { - l.Sort = ByNameAsc if l.SortReverse { l.Sort = ByNameDesc }