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:
parent
e6bdb36de3
commit
05161ec9df
1 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ var (
|
||||||
flAddKeywords = flag.String("K", "", "Add the specified (delimited by comma or space) keywords to the current set of keywords")
|
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")
|
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")
|
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{
|
var formats = map[string]func(*mtree.Result) string{
|
||||||
|
@ -41,11 +41,11 @@ var formats = map[string]func(*mtree.Result) string{
|
||||||
return buffer.String()
|
return buffer.String()
|
||||||
},
|
},
|
||||||
|
|
||||||
// Outputs only the paths which failed to validate.
|
// Outputs only the failure type and paths which failed to validate.
|
||||||
"path": func(r *mtree.Result) string {
|
"text": func(r *mtree.Result) string {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
for _, fail := range r.Failures {
|
for _, fail := range r.Failures {
|
||||||
fmt.Fprintln(&buffer, fail.Path)
|
fmt.Fprintf(&buffer, "modified\t%s\n", fail.Path)
|
||||||
}
|
}
|
||||||
return buffer.String()
|
return buffer.String()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue