cli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package cli is the `build` command: `wctr build` (ForEngine, for wctr's extension hook), and the standalone `wctr-build`.

Index

Constants

View Source
const DefaultHost = "unix:///var/run/wctr.sock"

DefaultHost is the engine's socket when neither -H nor WCTR_HOST says.

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command is `build` with the default wiring.

func ForEngine added in v0.2.0

func ForEngine(e HTTPEngine) *cobra.Command

ForEngine is `build` for wctr's command tree:

cli.Options{Extra: []func(cli.Engine) *cobra.Command{
	func(e cli.Engine) *cobra.Command { return buildcli.ForEngine(e) }}}

The build talks to the engine wctr's -H selects.

func NewCommand

func NewCommand(opt Options) *cobra.Command

NewCommand is `build` wired by opt.

Types

type HTTPEngine added in v0.2.0

type HTTPEngine interface {
	HTTP() (*http.Client, string, error)
}

HTTPEngine is how a host program hands over its engine: the engine's cli.Engine (wctr's Options.Extra) satisfies it.

type Options

type Options struct {
	// Engine returns the engine to build with; cmd is the build command
	// (its flags, and its parents', are parsed). Nil: dial the -H/--host
	// flag of the command or a parent, else $WCTR_HOST, else DefaultHost.
	Engine func(cmd *cobra.Command) (driver.Engine, error)
	// Cache is the step cache. Nil: a file under the user cache directory,
	// or a cache for this build only where there is none (a browser).
	Cache builder.Cache
	// Stdin is read for "-" (default os.Stdin).
	Stdin io.Reader
	// Limits bound the context (default buildcontext.DefaultLimits).
	Limits buildcontext.Limits
}

Options wire the command into a host program.

Jump to

Keyboard shortcuts

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