commands

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package commands contains the opnictl sub-commands.

Index

Constants

This section is empty.

Variables

View Source
var CompletionCmd = &cobra.Command{
	Use:   "completion [bash|zsh|fish]",
	Short: "Generate completion script",
	Long: `To load completions:

Bash:

  $ source <(yourprogram completion bash)

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

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:
  $ yourprogram completion zsh > "${fpath[1]}/_yourprogram"

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

fish:

  $ yourprogram completion fish | source

  # To load completions for each session, execute once:
  $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish
`,
	DisableFlagsInUseLine: true,
	ValidArgs:             []string{"bash", "zsh", "fish"},
	Args:                  cobra.ExactValidArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		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)
		}
	},
}

Functions

func BuildCreateClusterCmd added in v0.2.0

func BuildCreateClusterCmd() *cobra.Command

func BuildCreateCmd

func BuildCreateCmd() *cobra.Command

func BuildCreateDemoCmd

func BuildCreateDemoCmd() *cobra.Command

func BuildDeleteClusterCmd added in v0.2.0

func BuildDeleteClusterCmd() *cobra.Command

func BuildDeleteCmd

func BuildDeleteCmd() *cobra.Command

func BuildDeleteDemoCmd

func BuildDeleteDemoCmd() *cobra.Command

func BuildGetCmd

func BuildGetCmd() *cobra.Command

func BuildInstallCmd

func BuildInstallCmd() *cobra.Command

func BuildUninstallCmd

func BuildUninstallCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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