Add zero state

This commit is contained in:
Arturo Filastò 2018-06-22 11:57:25 +02:00
parent 6ff00eeed1
commit 04eb07624c

View File

@ -148,7 +148,12 @@ func logResultSummary(w io.Writer, f log.Fields) error {
tests := f.Get("total_tests").(int64)
dataUp := f.Get("total_data_usage_up").(int64)
dataDown := f.Get("total_data_usage_down").(int64)
if tests == 0 {
fmt.Fprintf(w, "No results\n")
fmt.Fprintf(w, "Try running:\n")
fmt.Fprintf(w, " ooni run websites\n")
return nil
}
// └┬──────────────┬──────────────┬──────────────┬
fmt.Fprintf(w, " │ %s │ %s │ %s │\n",
RightPad(fmt.Sprintf("%d tests", tests), 12),