mirror of
https://github.com/containers/podman.git
synced 2025-10-19 20:23:08 +08:00
Add space between num & unit in images output
Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
@ -6,8 +6,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
|
|
||||||
"github.com/containers/libpod/cmd/podman/formats"
|
"github.com/containers/libpod/cmd/podman/formats"
|
||||||
"github.com/containers/libpod/cmd/podman/libpodruntime"
|
"github.com/containers/libpod/cmd/podman/libpodruntime"
|
||||||
@ -16,6 +15,7 @@ import (
|
|||||||
"github.com/docker/go-units"
|
"github.com/docker/go-units"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -289,6 +289,8 @@ func getImagesTemplateOutput(ctx context.Context, runtime *libpod.Runtime, image
|
|||||||
sizeStr = err.Error()
|
sizeStr = err.Error()
|
||||||
} else {
|
} else {
|
||||||
sizeStr = units.HumanSizeWithPrecision(float64(*size), 3)
|
sizeStr = units.HumanSizeWithPrecision(float64(*size), 3)
|
||||||
|
lastNumIdx := strings.LastIndexFunc(sizeStr, unicode.IsNumber)
|
||||||
|
sizeStr = sizeStr[:lastNumIdx+1] + " " + sizeStr[lastNumIdx+1:]
|
||||||
}
|
}
|
||||||
params := imagesTemplateParams{
|
params := imagesTemplateParams{
|
||||||
Repository: repo,
|
Repository: repo,
|
||||||
|
Reference in New Issue
Block a user