Refactor podman to use c/common/pkg/report

All formatting for containers stack moved into one package
The does not correct issue with headers when using custom tables

Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
Jhon Honce
2020-10-20 10:29:49 -07:00
parent f96dbd0896
commit bab3cda0e8
35 changed files with 429 additions and 179 deletions

View File

@@ -0,0 +1,13 @@
package report
import "regexp"
var jsonRegex = regexp.MustCompile(`^\s*(json|{{\s*json\s*(\.)?\s*}})\s*$`)
// JSONFormat test CLI --format string to be a JSON request
// if report.IsJSON(cmd.Flag("format").Value.String()) {
// ... process JSON and output
// }
func IsJSON(s string) bool {
return jsonRegex.MatchString(s)
}