mirror of https://github.com/docker/cli.git
cli/command/formatter: export JSONFormat const
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
5acb64944f
commit
1aaa179d9d
|
@ -19,7 +19,7 @@ const (
|
||||||
JSONFormatKey = "json"
|
JSONFormatKey = "json"
|
||||||
|
|
||||||
DefaultQuietFormat = "{{.ID}}"
|
DefaultQuietFormat = "{{.ID}}"
|
||||||
jsonFormat = "{{json .}}"
|
JSONFormat = "{{json .}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Format is the format string rendered using the Context
|
// Format is the format string rendered using the Context
|
||||||
|
@ -62,7 +62,7 @@ func (c *Context) preFormat() {
|
||||||
case c.Format.IsTable():
|
case c.Format.IsTable():
|
||||||
c.finalFormat = c.finalFormat[len(TableFormatKey):]
|
c.finalFormat = c.finalFormat[len(TableFormatKey):]
|
||||||
case c.Format.IsJSON():
|
case c.Format.IsJSON():
|
||||||
c.finalFormat = jsonFormat
|
c.finalFormat = JSONFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
c.finalFormat = strings.Trim(c.finalFormat, " ")
|
c.finalFormat = strings.Trim(c.finalFormat, " ")
|
||||||
|
|
Loading…
Reference in New Issue