cmd

package
v0.0.0-...-68d4ac6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AppName returns the application name.
	AppName = filepath.Base(os.Args[0])
)

Functions

func NewCommand

func NewCommand(ctx context.Context, args []string) *cobra.Command

NewCommand creates the aos root command.

func UsageErrorf

func UsageErrorf(cmd *cobra.Command, format string, args ...interface{}) error

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

IOStreams provides the standard names for iostreams.

This is useful for embedding and for unit testing.

func NewTestIOStreams

func NewTestIOStreams() (IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer)

NewTestIOStreams returns a valid IOStreams and in, out, errout buffers for unit tests

func NewTestIOStreamsDiscard

func NewTestIOStreamsDiscard() IOStreams

NewTestIOStreamsDiscard returns a valid IOStreams that just discards

Jump to

Keyboard shortcuts

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