Help us shape the future of Go! Take the 2026 Go Developer Survey

clicompletion

package
v1.3.104-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package clicompletion cmd/skywire-cli/commands/completion/completion.go c4-vis-cli

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "completion [bash|zsh|fish|powershell]",
	Short: "Generate a shell completion script",
	Long: `Generate a shell completion script for skywire-cli and write it to stdout.

Load it into the current shell, or install it where your shell looks for
completions:

  # bash (current shell)
  source <(skywire-cli completion bash)
  # bash (persistent, Linux)
  skywire-cli completion bash > /etc/bash_completion.d/skywire-cli

  # zsh
  skywire-cli completion zsh > "${fpath[1]}/_skywire-cli"

  # fish
  skywire-cli completion fish > ~/.config/fish/completions/skywire-cli.fish

  # powershell
  skywire-cli completion powershell | Out-String | Invoke-Expression`,
	DisableFlagsInUseLine: true,
	ValidArgs:             []string{"bash", "zsh", "fish", "powershell"},

	Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
	Run: func(cmd *cobra.Command, args []string) {
		switch args[0] {
		case "bash":
			err := cmd.Root().GenBashCompletion(cmdutil.Stdout())
			if err != nil {
				panic(err)
			}
		case "zsh":
			err := cmd.Root().GenZshCompletion(cmdutil.Stdout())
			if err != nil {
				panic(err)
			}
		case "fish":
			err := cmd.Root().GenFishCompletion(cmdutil.Stdout(), true)
			if err != nil {
				panic(err)
			}
		case "powershell":
			err := cmd.Root().GenPowerShellCompletion(cmdutil.Stdout())
			if err != nil {
				panic(err)
			}
		}
	},
}

RootCmd contains commands that interact with the auto-completion scripts of skywire-cli

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL