completion

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "completion",
	Short: "Generates completion scripts",
	Long: `To load completions:

Bash:

  $ source <(aftctl completion bash)

  # To load completions for each session, execute once:
  # Linux:
  $ aftctl completion bash > /etc/bash_completion.d/aftctl
  # macOS:
  $ aftctl completion bash > /usr/local/etc/bash_completion.d/aftctl

Zsh:

  # If shell completion is not already enabled in your environment,
  # you will need to enable it.  You can execute the following once:

  $ echo "autoload -U compinit; compinit" >> ~/.zshrc

  # To load completions for each session, execute once:
  $ aftctl completion zsh > "${fpath[1]}/_aftctl"

  # You will need to start a new shell for this setup to take effect.

fish:

  $ aftctl completion fish | source

  # To load completions for each session, execute once:
  $ aftctl completion fish > ~/.config/fish/completions/aftctl.fish

PowerShell:

  PS> aftctl completion powershell | Out-String | Invoke-Expression

  # To load completions for every new session, run:
  PS> aftctl completion powershell > aftctl.ps1
  # and source this file from your PowerShell profile.
`,
	DisableFlagsInUseLine: true,
	ValidArgs:             []string{"bash", "zsh", "fish", "powershell"},
	Args:                  cobra.OnlyValidArgs,
	Run:                   Run,
}

Cmd represents the completion command for generating shell completion scripts.

Functions

func Run

func Run(cmd *cobra.Command, args []string)

Run is the main function for the 'completion' command. It delegates to RunCompletion.

func RunCompletion

func RunCompletion(cmd *cobra.Command, args []string, out io.Writer)

RunCompletion generates the shell completion script based on the provided arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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