Something went wrong. Try again.
Kagi Mail CLI client
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051package cmd
import ( "github.com/spf13/cobra")
func newCompletionCmd(f *Factory) *cobra.Command { return &cobra.Command{ Use: "completion <shell>", Short: "Generate shell completion scripts", Long: `Generate a shell completion script for km.
Supported shells: bash, zsh, fish, powershell.
Bash: Add to ~/.bashrc: eval "$(km completion bash)" or install system-wide: km completion bash > /etc/bash_completion.d/km
Zsh: Add to ~/.zshrc (after compinit): eval "$(km completion zsh)" or write it to a directory on your $fpath: km completion zsh > "${fpath[1]}/_km"
Fish: km completion fish > ~/.config/fish/completions/km.fish
PowerShell: Add to your profile: km completion powershell | Out-String | Invoke-Expression`, Args: cobra.ExactArgs(1), ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, RunE: func(cmd *cobra.Command, args []string) error { root, out := cmd.Root(), f.IO.Out switch args[0] { case "bash": return root.GenBashCompletionV2(out, true) case "zsh": return root.GenZshCompletion(out) case "fish": return root.GenFishCompletion(out, true) case "powershell": return root.GenPowerShellCompletionWithDesc(out) } return usagef("unsupported shell %q (use bash, zsh, fish or powershell)", args[0]) }, }}