diff --git a/cmd/build.go b/cmd/build.go index edb1126c..db34ad7b 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -141,10 +141,6 @@ Build packages specifying multiple definition trees: generalRecipe := tree.NewCompilerRecipe(db) - if len(treePaths) <= 0 { - Fatal("No tree path supplied!") - } - for _, src := range treePaths { Info("Loading tree", src) @@ -305,7 +301,7 @@ func init() { if err != nil { Fatal(err) } - buildCmd.Flags().StringSliceP("tree", "t", []string{}, "Path of the tree to use.") + buildCmd.Flags().StringSliceP("tree", "t", []string{path}, "Path of the tree to use.") buildCmd.Flags().String("backend", "docker", "backend used (docker,img)") buildCmd.Flags().Bool("privileged", false, "Privileged (Keep permissions)") buildCmd.Flags().String("database", "memory", "database used for solving (memory,boltdb)") diff --git a/cmd/create-repo.go b/cmd/create-repo.go index 7e86efb7..59eb8c44 100644 --- a/cmd/create-repo.go +++ b/cmd/create-repo.go @@ -150,7 +150,7 @@ func init() { Fatal(err) } createrepoCmd.Flags().String("packages", path, "Packages folder (output from build)") - createrepoCmd.Flags().StringSliceP("tree", "t", []string{}, "Path of the source trees to use.") + createrepoCmd.Flags().StringSliceP("tree", "t", []string{path}, "Path of the source trees to use.") createrepoCmd.Flags().String("output", path, "Destination folder") createrepoCmd.Flags().String("name", "luet", "Repository name") createrepoCmd.Flags().String("descr", "luet", "Repository description") diff --git a/cmd/tree/images.go b/cmd/tree/images.go index fda63262..a26bc150 100644 --- a/cmd/tree/images.go +++ b/cmd/tree/images.go @@ -18,6 +18,7 @@ package cmd_tree import ( "fmt" + "os" //. "github.com/mudler/luet/pkg/config" "github.com/ghodss/yaml" @@ -127,9 +128,12 @@ func NewTreeImageCommand() *cobra.Command { } }, } - + path, err := os.Getwd() + if err != nil { + Fatal(err) + } ans.Flags().StringP("output", "o", "terminal", "Output format ( Defaults: terminal, available: json,yaml )") - ans.Flags().StringArrayP("tree", "t", []string{}, "Path of the tree to use.") + ans.Flags().StringArrayP("tree", "t", []string{path}, "Path of the tree to use.") ans.Flags().String("image-repository", "luet/cache", "Default base image string for generated image") return ans diff --git a/cmd/tree/pkglist.go b/cmd/tree/pkglist.go index 91723459..84f59de7 100644 --- a/cmd/tree/pkglist.go +++ b/cmd/tree/pkglist.go @@ -18,6 +18,7 @@ package cmd_tree import ( "fmt" + "os" "sort" //. "github.com/mudler/luet/pkg/config" @@ -266,7 +267,10 @@ func NewTreePkglistCommand() *cobra.Command { }, } - + path, err := os.Getwd() + if err != nil { + Fatal(err) + } ans.Flags().BoolP("buildtime", "b", false, "Build time match") ans.Flags().StringP("output", "o", "terminal", "Output format ( Defaults: terminal, available: json,yaml )") ans.Flags().Bool("revdeps", false, "Search package reverse dependencies") @@ -274,7 +278,7 @@ func NewTreePkglistCommand() *cobra.Command { ans.Flags().BoolP("verbose", "v", false, "Add package version") ans.Flags().BoolP("full", "f", false, "Show package detail") - ans.Flags().StringArrayP("tree", "t", []string{}, "Path of the tree to use.") + ans.Flags().StringArrayP("tree", "t", []string{path}, "Path of the tree to use.") ans.Flags().StringSliceVarP(&matches, "matches", "m", []string{}, "Include only matched packages from list. (Use string as regex).") ans.Flags().StringSliceVarP(&excludes, "exclude", "e", []string{}, diff --git a/cmd/tree/validate.go b/cmd/tree/validate.go index 341b2d4c..002c548f 100644 --- a/cmd/tree/validate.go +++ b/cmd/tree/validate.go @@ -458,12 +458,15 @@ func NewTreeValidateCommand() *cobra.Command { } }, } - + path, err := os.Getwd() + if err != nil { + Fatal(err) + } ans.Flags().Bool("only-runtime", false, "Check only runtime dependencies.") ans.Flags().Bool("only-buildtime", false, "Check only buildtime dependencies.") ans.Flags().BoolP("with-solver", "s", false, "Enable check of requires also with solver.") - ans.Flags().StringSliceVarP(&treePaths, "tree", "t", []string{}, + ans.Flags().StringSliceVarP(&treePaths, "tree", "t", []string{path}, "Path of the tree to use.") ans.Flags().StringSliceVarP(&excludes, "exclude", "e", []string{}, "Exclude matched packages from analysis. (Use string as regex).")