cmd: rename --results-format=path to text

In order to provide enough context for the failure type to the caller,
we have to change this format.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-07-23 13:42:03 +10:00
parent e6bdb36de3
commit 05161ec9df
No known key found for this signature in database
GPG key ID: 9E18AA267DDB8DB4

View file

@ -19,7 +19,7 @@ var (
flAddKeywords = flag.String("K", "", "Add the specified (delimited by comma or space) keywords to the current set of keywords")
flUseKeywords = flag.String("k", "", "Use the specified (delimited by comma or space) keywords as the current set of keywords")
flListKeywords = flag.Bool("list-keywords", false, "List the keywords available")
flResultFormat = flag.String("result-format", "bsd", "output the validation results using the given format (bsd, json, path)")
flResultFormat = flag.String("result-format", "bsd", "output the validation results using the given format (bsd, json, text)")
)
var formats = map[string]func(*mtree.Result) string{
@ -41,11 +41,11 @@ var formats = map[string]func(*mtree.Result) string{
return buffer.String()
},
// Outputs only the paths which failed to validate.
"path": func(r *mtree.Result) string {
// Outputs only the failure type and paths which failed to validate.
"text": func(r *mtree.Result) string {
var buffer bytes.Buffer
for _, fail := range r.Failures {
fmt.Fprintln(&buffer, fail.Path)
fmt.Fprintf(&buffer, "modified\t%s\n", fail.Path)
}
return buffer.String()
},