From a5e125de4bba6481bbae0878f3cddb154aaa7b6b Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 3 Nov 2019 17:24:47 +0100 Subject: [PATCH] Query needs a category as well to find out the package --- cmd/query.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/query.go b/cmd/query.go index 878a72d1..aa1dcc67 100644 --- a/cmd/query.go +++ b/cmd/query.go @@ -35,7 +35,7 @@ var queryCmd = &cobra.Command{ input := viper.GetString("input") - if len(args) != 3 { + if len(args) != 4 { log.Fatalln("Incorrect number of arguments") } @@ -53,11 +53,12 @@ var queryCmd = &cobra.Command{ t := args[0] v := args[1] version := args[2] + cat := args[3] switch t { case "install": // XXX: pack needs to be the same which is present in world. // Tree caches generated world when using FindPackage - pack, err := generalRecipe.Tree().FindPackage(&pkg.DefaultPackage{Name: v, Version: version}) + pack, err := generalRecipe.Tree().FindPackage(&pkg.DefaultPackage{Category: cat, Name: v, Version: version}) if err != nil { fmt.Println("Error: " + err.Error()) os.Exit(1)