This commit is contained in:
Julien Vehent 2014-11-24 13:41:09 -05:00
Родитель d972a63c78
Коммит ac76d2985d
2 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -706,17 +706,23 @@ func PrintCommandResults(cmd mig.Command, onlyFound, showAgent bool) (err error)
if err != nil {
panic(err)
}
if len(cmd.Action.Operations) <= i {
fmt.Fprintf(os.Stderr, "%s[error] no operation maps results %d\n", prefix, i)
if !onlyFound {
for _, rerr := range result.Errors {
fmt.Fprintf(os.Stderr, "%s[error] %s\n", prefix, rerr)
}
}
if len(cmd.Action.Operations) <= i {
if !onlyFound {
fmt.Fprintf(os.Stderr, "%s[error] no operation maps results %d\n", prefix, i)
}
continue
}
// verify that we know the module
moduleName := cmd.Action.Operations[i].Module
if _, ok := mig.AvailableModules[moduleName]; !ok {
fmt.Fprintf(os.Stderr, "%s[error] unknown module '%s'\n", prefix, moduleName)
if !onlyFound {
fmt.Fprintf(os.Stderr, "%s[error] unknown module '%s'\n", prefix, moduleName)
}
continue
}
modRunner := mig.AvailableModules[moduleName]()
@ -730,7 +736,9 @@ func PrintCommandResults(cmd mig.Command, onlyFound, showAgent bool) (err error)
fmt.Printf("%s%s\n", prefix, res)
}
} else {
fmt.Fprintf(os.Stderr, "%s[error] no printer available for module '%s'\n", prefix, moduleName)
if !onlyFound {
fmt.Fprintf(os.Stderr, "%s[error] no printer available for module '%s'\n", prefix, moduleName)
}
}
}
if !onlyFound {

Просмотреть файл

@ -1347,9 +1347,6 @@ func (r Runner) PrintResults(rawResults []byte, foundOnly bool) (prints []string
}
}
if !foundOnly {
for _, we := range results.Errors {
prints = append(prints, we)
}
stat := fmt.Sprintf("Statistics: %.0f checks tested on %.0f files. %.0f failed to open. %.0f checks matched on %.0f files. %.0f total hits. ran in %s.",
results.Statistics.Checkcount, results.Statistics.Filescount, results.Statistics.Openfailed, results.Statistics.Checksmatch, results.Statistics.Uniquefiles,
results.Statistics.Totalhits, results.Statistics.Exectime)