From 04eb07624cc42300acb741e9d5f96e05bd791ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 22 Jun 2018 11:57:25 +0200 Subject: [PATCH] Add zero state --- internal/log/handlers/cli/results.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/log/handlers/cli/results.go b/internal/log/handlers/cli/results.go index 391fa46..50ca767 100644 --- a/internal/log/handlers/cli/results.go +++ b/internal/log/handlers/cli/results.go @@ -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),