plugin

package
v0.25.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package plugin provides functions to create new CLI plugins.

Index

Constants

View Source
const CmdTemplate = `` /* 1078-byte string literal not displayed */

CmdTemplate is the template for plugin commands.

Variables

View Source
var UsageFunc = func(c *cobra.Command) error {
	t, err := template.New("usage").Funcs(cli.TemplateFuncs).Parse(CmdTemplate)
	if err != nil {
		return err
	}
	return t.Execute(os.Stdout, c)
}

UsageFunc is the usage func for a plugin.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Cmd *cobra.Command
}

Plugin is a Tanzu CLI plugin.

func NewPlugin

func NewPlugin(descriptor *cliv1alpha1.PluginDescriptor) (*Plugin, error)

NewPlugin creates an instance of Plugin.

func NewPluginFromFile

func NewPluginFromFile(path string) (*Plugin, error)

NewPluginFromFile create a new instance of Plugin from a file descriptor.

func (*Plugin) AddCommands

func (p *Plugin) AddCommands(commands ...*cobra.Command)

AddCommands adds commands to the plugin.

func (*Plugin) Execute

func (p *Plugin) Execute() error

Execute executes the plugin.

Directories

Path Synopsis
Package lint provides linters to run against CLI plugins.
Package lint provides linters to run against CLI plugins.

Jump to

Keyboard shortcuts

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