cli

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package cli maps mutti's commands and flags onto the use cases in app and renders their results.

Index

Constants

View Source
const (
	CodeUsage                = "usage"                 // wrong flags or arguments
	CodeConfirmationRequired = "confirmation-required" // destructive without --yes and no terminal
	CodeError                = "error"                 // a failure without a code of its own
)

Error codes of the command line itself; the others are app's.

View Source
const (
	ExitError = 125 // mutti itself failed
	ExitCheck = 1   // a check (doctor) found problems
)

Exit codes of mutti's own failures, following Docker's convention.

View Source
const CodePortInUse = "port-in-use"

CodePortInUse means mutti serve cannot listen on its port.

View Source
const SchemaVersion = 1

SchemaVersion of the --json output. Fields are only ever added; a breaking change bumps it.

Variables

This section is empty.

Functions

func Commands

func Commands() *cobra.Command

Commands returns mutti's built-in command tree without any project, for generated docs.

func Run

func Run(ctx context.Context, d Deps, args []string) int

Run executes mutti with args and returns the process exit code.

Types

type Deps

type Deps struct {
	App     *app.App
	Dir     string // working directory
	In      io.Reader
	Out     io.Writer
	Err     io.Writer
	Version string
	OutTTY  bool // Out is a terminal
}

Deps are what the commands run against.

Jump to

Keyboard shortcuts

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