mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-07 17:36:22 +00:00
* --format "table {{.field..." will print fields out in a table with
headings. Table keyword is removed, spaces between fields are
converted to tabs
* Update parse.MatchesJSONFormat()'s regex to be more inclusive
* Add report.Headers(), obtain all the field names to be used as
column headers, a map of field name to column headers may be provided
to override the field names
* Update several commands to use new functions
Signed-off-by: Jhon Honce <jhonce@redhat.com>
10 lines
266 B
Go
10 lines
266 B
Go
package parse
|
|
|
|
import "regexp"
|
|
|
|
var jsonFormatRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*( \.)?\s*}})\s*$`)
|
|
|
|
// MatchesJSONFormat test CLI --format string to be a JSON request
|
|
func MatchesJSONFormat(s string) bool {
|
|
return jsonFormatRegex.Match([]byte(s))
|
|
}
|