cmd

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 83 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPrintedError = errors.New("terminating because of errors")

ErrPrintedError indicates error messages have been printed to stderr.

Functions

func Main

func Main() int

Main runs the cue tool and returns the code for passing to os.Exit.

func MainTest added in v0.0.12

func MainTest() int

MainTest is like Main, runs the cue tool and returns the code for passing to os.Exit.

Types

type Command

type Command struct {
	// The currently active command.
	*cobra.Command
	// contains filtered or unexported fields
}

func New

func New(args []string) (*Command, error)

New creates the top-level command. The returned error is always nil, and is a historical artifact.

func (*Command) Run

func (c *Command) Run(ctx context.Context) (err error)

func (*Command) SetInput

func (c *Command) SetInput(r io.Reader)

func (*Command) SetOutput

func (c *Command) SetOutput(w io.Writer)

func (*Command) Stderr added in v0.0.9

func (c *Command) Stderr() io.Writer

Stderr returns a writer that should be used for error messages.

type Stats added in v0.6.0

type Stats struct {
	// CUE groups stats obtained from the CUE evaluator.
	CUE stats.Counts

	// Go groups stats obtained from the Go runtime.
	Go struct {
		AllocBytes   uint64
		AllocObjects uint64
	}
}

Stats expands stats.Counts with counters obtained from other sources, such as the Go runtime. The stats are grouped by category to clarify their source.

Jump to

Keyboard shortcuts

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