diff --git a/cmd/completion.go b/cmd/completion.go index 9011e5c..b6f631f 100644 --- a/cmd/completion.go +++ b/cmd/completion.go @@ -187,6 +187,7 @@ func InitCompletionCmd(rootCmd *cobra.Command, cfg *config.Config) func(cfg *con Use: "completion", Hidden: true, Short: "Generates completion scripts for bash, zsh", + GroupID: "internal", RunE: func(cmd *cobra.Command, args []string) error { shellType, err := cmd.Flags().GetString("shell") if err != nil { diff --git a/cmd/root.go b/cmd/root.go index 2885a56..5bec729 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,7 +9,7 @@ import ( // newRootCmd represents the base command when called without any subcommands. func newRootCmd(version string) *cobra.Command { - return &cobra.Command{ + cmd := &cobra.Command{ Use: "lets", Short: "A CLI task runner", Args: cobra.ArbitraryArgs, @@ -24,6 +24,9 @@ func newRootCmd(version string) *cobra.Command { // print help message manyally SilenceUsage: true, } + cmd.AddGroup(&cobra.Group{"main", "Commands:"}, &cobra.Group{"internal", "Internal commands:"}) + cmd.SetHelpCommandGroupID("internal") + return cmd } // CreateRootCommand used to run only root command without config. diff --git a/cmd/self.go b/cmd/self.go index 6fd2b23..a881a00 100644 --- a/cmd/self.go +++ b/cmd/self.go @@ -10,6 +10,7 @@ func InitSelfCmd(rootCmd *cobra.Command, version string) { Use: "self", Hidden: false, Short: "Manage lets CLI itself", + GroupID: "internal", RunE: func(cmd *cobra.Command, args []string) error { return PrintHelpMessage(cmd) }, diff --git a/cmd/subcommand.go b/cmd/subcommand.go index e6e990a..b2d9f1e 100644 --- a/cmd/subcommand.go +++ b/cmd/subcommand.go @@ -159,6 +159,7 @@ func newSubcommand(command *config.Command, conf *config.Config, showAll bool, o subCmd := &cobra.Command{ Use: command.Name, Short: short(command.Description), + GroupID: "main", Hidden: isHidden(command.Name, showAll), RunE: func(cmd *cobra.Command, args []string) error { command.Args = append(command.Args, prepareArgs(command.Name, os.Args)...) diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index 67f27b8..9f8d206 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -5,13 +5,16 @@ title: Changelog ## [Unreleased](https://github.com/lets-cli/lets/releases/tag/v0.0.X) -## [0.0.55](https://github.com/lets-cli/lets/releases/tag/v0.0.54) +## [0.0.55](https://github.com/lets-cli/lets/releases/tag/v0.0.55) * `[Added]` `lets self` command that is ment to be a new home for all lets own commands such as `completions` (soon) or `lsp` * `[Added]` `lets self lsp` command that starts built-in `lsp` server with go to definition support and completions * [`Development`] Since `lsp` implementation uses `https://tree-sitter.github.io` (C library with go bindings) as a internal parser `lets` now build with `CGO_ENABLED=1`. If you are building on local machine, you do not have to specify `CGO_ENABLED` env variable. But you may have to install some build system dependencies in case compilatino fails. +* `[CI]` reworked release pipeline now supports go cross compilation +* `[Improvment]` split commands in help message into `Commands` and `Internal commands` * `[Dependency]` update go to `1.23` -* `[Dependency]` update goreleaser to `2.x` +* `[Dependency]` update goreleaser to `1.63.x` +* `[Dependency]` update golangci-lint to `2.x` (also applied some lint fixes across codebase) ## [0.0.54](https://github.com/lets-cli/lets/releases/tag/v0.0.54) diff --git a/tests/help.bats b/tests/help.bats index a327856..de45036 100644 --- a/tests/help.bats +++ b/tests/help.bats @@ -13,9 +13,11 @@ Usage: lets [flags] lets [command] -Available Commands: +Commands: bar Print bar foo Print foo + +Internal commands: help Help about any command self Manage lets CLI itself @@ -43,10 +45,12 @@ Usage: lets [flags] lets [command] -Available Commands: +Commands: _x Hidden x bar Print bar foo Print foo + +Internal commands: help Help about any command self Manage lets CLI itself