Skip to content

Commit 64e6cf3

Browse files
authored
refactor(cmd): rm duplicated completions cmd (ignite#2716)
1 parent e5bd64f commit 64e6cf3

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

ignite/cmd/tools.go

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func NewTools() *cobra.Command {
2222
c.AddCommand(NewToolsIBCSetup())
2323
c.AddCommand(NewToolsIBCRelayer())
2424
c.AddCommand(NewToolsProtoc())
25-
c.AddCommand(NewToolsCompletions())
2625
return c
2726
}
2827

@@ -87,74 +86,3 @@ func toolsProxy(ctx context.Context, command []string) error {
8786
),
8887
)
8988
}
90-
91-
func NewToolsCompletions() *cobra.Command {
92-
// completionCmd represents the completion command
93-
c := &cobra.Command{
94-
Use: "completions",
95-
Short: "Generate completions script",
96-
Long: ` The completions command outputs a completion script you can use in your shell. The output script requires
97-
that [bash-completion](https://github.com/scop/bash-completion) is installed and enabled in your
98-
system. Since most Unix-like operating systems come with bash-completion by default, bash-completion
99-
is probably already installed and operational.
100-
101-
Bash:
102-
103-
$ source <(ignite tools completions bash)
104-
105-
To load completions for every new session, run:
106-
107-
** Linux **
108-
$ ignite tools completions bash > /etc/bash_completion.d/ignite
109-
110-
** macOS **
111-
$ ignite tools completions bash > /usr/local/etc/bash_completion.d/ignite
112-
113-
Zsh:
114-
115-
If shell completions is not already enabled in your environment, you will need to enable it. You can execute the following once:
116-
117-
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
118-
119-
To load completions for each session, execute once:
120-
121-
$ ignite tools completions zsh > "${fpath[1]}/_ignite"
122-
123-
You will need to start a new shell for this setup to take effect.
124-
125-
fish:
126-
127-
$ ignite tools completions fish | source
128-
129-
To load completions for each session, execute once:
130-
131-
$ ignite tools completions fish > ~/.config/fish/completionss/ignite.fish
132-
133-
PowerShell:
134-
135-
PS> ignite tools completions powershell | Out-String | Invoke-Expression
136-
137-
To load completions for every new session, run:
138-
139-
PS> ignite tools completions powershell > ignite.ps1
140-
141-
and source this file from your PowerShell profile.
142-
`,
143-
DisableFlagsInUseLine: true,
144-
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
145-
Args: cobra.ExactValidArgs(1),
146-
Run: func(cmd *cobra.Command, args []string) {
147-
switch args[0] {
148-
case "bash":
149-
cmd.Root().GenBashCompletion(os.Stdout)
150-
case "zsh":
151-
cmd.Root().GenZshCompletion(os.Stdout)
152-
case "fish":
153-
cmd.Root().GenFishCompletion(os.Stdout, true)
154-
case "powershell":
155-
cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
156-
}
157-
},
158-
}
159-
return c
160-
}

0 commit comments

Comments
 (0)