Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

- [#3835](https://github.com/ignite/cli/pull/3835) Add `--minimal` flag to `scaffold chain` to scaffold a chain with the least amount of sdk modules


### Changes

- [#3899](https://github.com/ignite/cli/pull/3899) Introduce plugin.Execute function

### Bug Fixes

- [#3905](https://github.com/ignite/cli/pull/3905) Fix `ignite completion`

## [`v28.1.1`](https://github.com/ignite/cli/releases/tag/v28.1.1)

### Fixes
Expand Down
3 changes: 2 additions & 1 deletion ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To get started, create a blockchain:
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// Check for new versions only when shell completion scripts are not being
// generated to avoid invalid output to stdout when a new version is available
if cmd.Use != "completions" {
if cmd.Use != "completion" {
checkNewVersion(cmd.Context())
}

Expand All @@ -81,6 +81,7 @@ To get started, create a blockchain:
NewVersion(),
NewApp(),
NewDoctor(),
NewCompletionCmd(),
)
c.AddCommand(deprecated()...)

Expand Down
33 changes: 33 additions & 0 deletions ignite/cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package ignitecmd

import (
"os"

"github.com/spf13/cobra"
)

// completionCmd represents the completion command
func NewCompletionCmd() *cobra.Command {
return &cobra.Command{
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generates shell completion script.",
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
cmd.Help()
os.Exit(0)
}
switch args[0] {
case "bash":
cmd.Root().GenBashCompletion(os.Stdout)
case "zsh":
cmd.Root().GenZshCompletion(os.Stdout)
case "fish":
cmd.Root().GenFishCompletion(os.Stdout, true)
case "powershell":
cmd.Root().GenPowerShellCompletion(os.Stdout)
default:
cmd.Help()
}
},
}
}