diff --git a/cmd/create-repo.go b/cmd/create-repo.go index 05db0494..ed42b773 100644 --- a/cmd/create-repo.go +++ b/cmd/create-repo.go @@ -30,7 +30,26 @@ import ( var createrepoCmd = &cobra.Command{ Use: "create-repo", Short: "Create a luet repository from a build", - Long: `Generate and renew repository metadata`, + Long: `Builds tree metadata from a set of packages and a tree definition: + + $ luet create-repo + +Provide specific paths for packages, tree, and metadata output which is generated: + + $ luet create-repo --packages my/packages/path --tree my/tree/path --output my/packages/path ... + +Provide name and description of the repository: + + $ luet create-repo --name "foo" --description "bar" ... + +Change compression method: + + $ luet create-repo --tree-compression gzip --meta-compression gzip + +Create a repository from the metadata description defined in the luet.yaml config file: + + $ luet create-repo --repo repository1 +`, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlag("packages", cmd.Flags().Lookup("packages")) viper.BindPFlag("tree", cmd.Flags().Lookup("tree")) diff --git a/cmd/database.go b/cmd/database.go index 953906da..901b75f5 100644 --- a/cmd/database.go +++ b/cmd/database.go @@ -25,6 +25,10 @@ import ( var databaseGroupCmd = &cobra.Command{ Use: "database [command] [OPTIONS]", Short: "Manage system database (dangerous commands ahead!)", + Long: `Allows to manipulate Luet internal database of installed packages. Use with caution! + +Removing packages by hand from the database can result in a broken system, and thus it's not reccomended. +`, } func init() { diff --git a/cmd/database/create.go b/cmd/database/create.go index 65f8b35b..1c4982c0 100644 --- a/cmd/database/create.go +++ b/cmd/database/create.go @@ -32,7 +32,18 @@ func NewDatabaseCreateCommand() *cobra.Command { var ans = &cobra.Command{ Use: "create ", Short: "Insert a package in the system DB", - Args: cobra.OnlyValidArgs, + Long: `Inserts a package in the system database: + + $ luet database create foo.yaml + +"luet database create" injects a package in the system database without actually installing it, use it with caution. + +This commands takes multiple yaml input file representing package artifacts, that are usually generated while building packages. + +The yaml must contain the package definition, and the file list at least. + +For reference, inspect a "metadata.yaml" file generated while running "luet build"`, + Args: cobra.OnlyValidArgs, PreRun: func(cmd *cobra.Command, args []string) { LuetCfg.Viper.BindPFlag("system.database_path", cmd.Flags().Lookup("system-dbpath")) LuetCfg.Viper.BindPFlag("system.rootfs", cmd.Flags().Lookup("system-target")) diff --git a/cmd/database/remove.go b/cmd/database/remove.go index c267ff16..7d20e066 100644 --- a/cmd/database/remove.go +++ b/cmd/database/remove.go @@ -31,7 +31,13 @@ func NewDatabaseRemoveCommand() *cobra.Command { var ans = &cobra.Command{ Use: "remove [package1] [package2] ...", Short: "Remove a package from the system DB (forcefully - you normally don't want to do that)", - Args: cobra.OnlyValidArgs, + Long: `Removes a package in the system database without actually uninstalling it: + + $ luet database remove foo/bar + +This commands takes multiple packages as arguments and prunes their entries from the system database. +`, + Args: cobra.OnlyValidArgs, PreRun: func(cmd *cobra.Command, args []string) { LuetCfg.Viper.BindPFlag("system.database_path", cmd.Flags().Lookup("system-dbpath")) LuetCfg.Viper.BindPFlag("system.rootfs", cmd.Flags().Lookup("system-target")) diff --git a/cmd/pack.go b/cmd/pack.go index 9bb9e58e..560baa0c 100644 --- a/cmd/pack.go +++ b/cmd/pack.go @@ -31,7 +31,16 @@ import ( var packCmd = &cobra.Command{ Use: "pack ", Short: "pack a custom package", - Long: `pack and creates metadata directly from a source path`, + Long: `Pack creates a package from a directory, generating the metadata required from a tree to generate a repository. + +Pack can be used to manually replace what "luet build" does automatically by reading the packages build.yaml files. + + $ mkdir -p output/etc/foo + $ echo "my config" > output/etc/foo + $ luet pack foo/bar@1.1 --source output + +Afterwards, you can use the content generated and associate it with a tree and a corresponding definition.yaml file with "luet create-repo". +`, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlag("destination", cmd.Flags().Lookup("destination")) viper.BindPFlag("compression", cmd.Flags().Lookup("compression")) diff --git a/cmd/reclaim.go b/cmd/reclaim.go index 9240cc57..ae066389 100644 --- a/cmd/reclaim.go +++ b/cmd/reclaim.go @@ -35,8 +35,12 @@ var reclaimCmd = &cobra.Command{ LuetCfg.Viper.BindPFlag("system.rootfs", cmd.Flags().Lookup("system-target")) LuetCfg.Viper.BindPFlag("force", cmd.Flags().Lookup("force")) }, - Long: `Add packages to the systemdb if files belonging to packages -in available repositories exists in the target root.`, + Long: `Reclaim tries to find association between packages in the online repositories and the system one. + + $ luet reclaim + +It scans the target file system, and if finds a match with a package available in the repositories, it marks as installed in the system database. +`, Run: func(cmd *cobra.Command, args []string) { var systemDB pkg.PackageDatabase diff --git a/cmd/search.go b/cmd/search.go index 706c543e..aa8de7e6 100644 --- a/cmd/search.go +++ b/cmd/search.go @@ -66,9 +66,41 @@ func packageToList(l list.Writer, repo string, p pkg.Package) { } var searchCmd = &cobra.Command{ - Use: "search ", - Short: "Search packages", - Long: `Search for installed and available packages`, + Use: "search ", + Short: "Search packages", + Long: `Search for installed and available packages + +To search a package in the repositories: + + $ luet search + +To search a package and display results in a table (wide screens): + + $ luet search --table + +To look into the installed packages: + + $ luet search --installed + +Note: the regex argument is optional, if omitted implies "all" + +To search a package by label: + + $ luet search --by-label