summaryrefslogtreecommitdiff
path: root/cmd/kpod/history.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2017-12-12 11:33:28 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-12 21:53:53 +0000
commitcfb4e15e430e63b17420e80c0f6030a12fa1fb4a (patch)
treef740bb59926d7f33da5cb21162614300a18b9598 /cmd/kpod/history.go
parent39b697d9afb4f4a08f16eee58690e61c897bf1aa (diff)
downloadpodman-cfb4e15e430e63b17420e80c0f6030a12fa1fb4a.tar.gz
podman-cfb4e15e430e63b17420e80c0f6030a12fa1fb4a.tar.bz2
podman-cfb4e15e430e63b17420e80c0f6030a12fa1fb4a.zip
\t was not being recognized as tab in --format
When doing kpod images --format "{{.ID}}\t{{.Tag}}" the "\t" was being passed in as a string of "\" and "t" instead of as a tab character. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #123 Approved by: rhatdan
Diffstat (limited to 'cmd/kpod/history.go')
-rw-r--r--cmd/kpod/history.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/kpod/history.go b/cmd/kpod/history.go
index 211a843d0..20422b7c3 100644
--- a/cmd/kpod/history.go
+++ b/cmd/kpod/history.go
@@ -92,10 +92,7 @@ func historyCmd(c *cli.Context) error {
}
defer runtime.Shutdown(false)
- format := genHistoryFormat(c.Bool("quiet"))
- if c.IsSet("format") {
- format = c.String("format")
- }
+ format := genHistoryFormat(c.String("format"), c.Bool("quiet"))
args := c.Args()
if len(args) == 0 {
@@ -121,7 +118,12 @@ func historyCmd(c *cli.Context) error {
return generateHistoryOutput(history, layers, imageID, opts)
}
-func genHistoryFormat(quiet bool) (format string) {
+func genHistoryFormat(format string, quiet bool) string {
+ if format != "" {
+ // "\t" from the command line is not being recognized as a tab
+ // replacing the string "\t" to a tab character if the user passes in "\t"
+ return strings.Replace(format, `\t`, "\t", -1)
+ }
if quiet {
return formats.IDString
}