зеркало из https://github.com/mozilla/mig.git
[minor] print module errors
This commit is contained in:
Родитель
d972a63c78
Коммит
ac76d2985d
|
@ -706,17 +706,23 @@ func PrintCommandResults(cmd mig.Command, onlyFound, showAgent bool) (err error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if len(cmd.Action.Operations) <= i {
|
if !onlyFound {
|
||||||
fmt.Fprintf(os.Stderr, "%s[error] no operation maps results %d\n", prefix, i)
|
|
||||||
for _, rerr := range result.Errors {
|
for _, rerr := range result.Errors {
|
||||||
fmt.Fprintf(os.Stderr, "%s[error] %s\n", prefix, rerr)
|
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
|
continue
|
||||||
}
|
}
|
||||||
// verify that we know the module
|
// verify that we know the module
|
||||||
moduleName := cmd.Action.Operations[i].Module
|
moduleName := cmd.Action.Operations[i].Module
|
||||||
if _, ok := mig.AvailableModules[moduleName]; !ok {
|
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
|
continue
|
||||||
}
|
}
|
||||||
modRunner := mig.AvailableModules[moduleName]()
|
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)
|
fmt.Printf("%s%s\n", prefix, res)
|
||||||
}
|
}
|
||||||
} else {
|
} 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 {
|
if !onlyFound {
|
||||||
|
|
|
@ -1347,9 +1347,6 @@ func (r Runner) PrintResults(rawResults []byte, foundOnly bool) (prints []string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !foundOnly {
|
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.",
|
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.Checkcount, results.Statistics.Filescount, results.Statistics.Openfailed, results.Statistics.Checksmatch, results.Statistics.Uniquefiles,
|
||||||
results.Statistics.Totalhits, results.Statistics.Exectime)
|
results.Statistics.Totalhits, results.Statistics.Exectime)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче