isula-build: make isula-build ctr-img images display comfortably

Signed-off-by: leizhongkai <leizhongkai@huawei.com>
This commit is contained in:
leizhongkai 2021-02-04 20:22:15 +08:00 committed by leizhongkai
parent d2acc41c9b
commit f7cf3d08ea
5 changed files with 85 additions and 3 deletions

View File

@ -1 +1 @@
0.9.5-1
0.9.5-2

View File

@ -1 +1 @@
862d3b9742ceb1028d154284b5af5a889db99633
aae0cf132f1445fb4f79ab80c1431a157e089590

View File

@ -2,7 +2,7 @@
Name: isula-build
Version: 0.9.5
Release: 1
Release: 2
Summary: A tool to build container images
License: Mulan PSL V2
URL: https://gitee.com/openeuler/isula-build
@ -85,6 +85,12 @@ fi
/usr/share/bash-completion/completions/isula-build
%changelog
* Thu Feb 4 2021 leizhongkai<leizhongkai@huawei.com> - 0.9.5-2
- Type:enhancement
- CVE:NA
- SUG:restart
- DESC:make `isula-build ctr-img images` display comfortably
* Tue Jan 26 2021 lixiang <lixiang172@huawei.com> - 0.9.5-1
- Type:enhancement
- CVE:NA

View File

@ -0,0 +1,75 @@
From f97d236951af0ed82854e25319ff35542c04a010 Mon Sep 17 00:00:00 2001
From: Lu Jingxiao <lujingxiao@huawei.com>
Date: Thu, 4 Feb 2021 20:04:01 +0800
Subject: [PATCH] update images display
---
cmd/cli/images.go | 1 +
vendor/github.com/bndr/gotabulate/tabulate.go | 20 +++++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/cmd/cli/images.go b/cmd/cli/images.go
index bded3617..0405a34b 100644
--- a/cmd/cli/images.go
+++ b/cmd/cli/images.go
@@ -100,5 +100,6 @@ func formatAndPrint(images []*pb.ListResponse_ImageInfo) {
tabulate := gotabulate.Create(lines)
tabulate.SetHeaders(title)
tabulate.SetAlign("left")
+ tabulate.SetDenseMode(true)
fmt.Print(tabulate.Render("simple"))
}
diff --git a/vendor/github.com/bndr/gotabulate/tabulate.go b/vendor/github.com/bndr/gotabulate/tabulate.go
index a2e43265..095c11d8 100644
--- a/vendor/github.com/bndr/gotabulate/tabulate.go
+++ b/vendor/github.com/bndr/gotabulate/tabulate.go
@@ -1,10 +1,13 @@
package gotabulate
-import "fmt"
-import "bytes"
-import "github.com/mattn/go-runewidth"
-import "unicode/utf8"
-import "math"
+import (
+ "bytes"
+ "fmt"
+ "math"
+ "unicode/utf8"
+
+ "github.com/mattn/go-runewidth"
+)
// Basic Structure of TableFormat
type TableFormat struct {
@@ -84,6 +87,7 @@ type Tabulate struct {
WrapStrings bool
WrapDelimiter rune
SplitConcat string
+ DenseMode bool
}
// Represents normalized tabulate Row
@@ -208,6 +212,10 @@ func (t *Tabulate) SetWrapDelimiter(r rune) {
t.WrapDelimiter = r
}
+func (t *Tabulate) SetDenseMode(m bool) {
+ t.DenseMode = m
+}
+
//SetSplitConcat assigns the character that will be used when a WrapDelimiter is
//set but the renderer cannot abide by the desired split. This may happen when
//the WrapDelimiter is a space ' ' but a single word is longer than the width of a cell
@@ -292,7 +300,7 @@ func (t *Tabulate) Render(format ...interface{}) string {
// Add Data Rows
for index, element := range t.Data {
lines = append(lines, t.buildRow(t.padRow(element.Elements, t.TableFormat.Padding), padded_widths, cols, t.TableFormat.DataRow))
- if index < len(t.Data)-1 {
+ if !t.DenseMode && index < len(t.Data)-1 {
if element.Continuos != true && !inSlice("betweenLine", t.HideLines) {
lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBetweenRows))
}
--
2.23.0

View File

@ -2,3 +2,4 @@ patch/0013-vendor-change-auth.json-file-mode-from-0700-to-0600.patch
patch/0030-xattr-support-ima-and-evm.patch
patch/0033-isula-build-remove-docker-releated-path-for-authenti.patch
patch/0037-isula-build-fix-goroutine-leak-problem.patch
patch/0038-vendor-update-images-display.patch