From 0a550363b8f519d6d80b8ec453e0d0df4d0ae244 Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Sat, 1 Jan 2022 21:46:38 +0100 Subject: [PATCH] fix: correctly count recipes --- cli/recipe/list.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/recipe/list.go b/cli/recipe/list.go index d610ae76..cc337889 100644 --- a/cli/recipe/list.go +++ b/cli/recipe/list.go @@ -40,6 +40,7 @@ var recipeListCommand = &cli.Command{ tableCol := []string{"name", "category", "status", "healthcheck", "backups", "email", "tests", "SSO"} table := formatter.CreateTable(tableCol) + len := 0 for _, recipe := range recipes { tableRow := []string{ recipe.Name, @@ -55,13 +56,15 @@ var recipeListCommand = &cli.Command{ if pattern != "" { if strings.Contains(recipe.Name, pattern) { table.Append(tableRow) + len++ } } else { table.Append(tableRow) + len++ } } - table.SetCaption(true, fmt.Sprintf("total recipes: %v", len(recipes))) + table.SetCaption(true, fmt.Sprintf("total recipes: %v", len)) if table.NumLines() > 0 { table.Render()