cli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 47 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 cli defines the mdc command tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context) error

Execute runs the root command and returns its error for the caller to report.

func ExitCode

func ExitCode(err error) (int, bool)

ExitCode extracts the process exit code requested by err.

func Register

func Register(f CommandFactory)

Register adds a subcommand to the root command. Call it from init.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App gives commands access to the global settings, resolved from flags, MDC_* environment variables and the optional config file.

func (*App) BackendOptions

func (a *App) BackendOptions() backend.Options

BackendOptions returns the compose-level settings for backend.New.

func (*App) Depth

func (a *App) Depth() int

Depth is how many directory levels below the working directory are scanned.

func (*App) Discover

func (a *App) Discover() (discover.Result, error)

Discover finds the compose projects under the working directory.

func (*App) Jobs

func (a *App) Jobs() int

Jobs is the maximum number of projects run at once; 0 means all.

type CommandFactory

type CommandFactory func(app *App) *cobra.Command

CommandFactory builds a subcommand that uses the shared App.

type ExitError

type ExitError struct{ Code int }

ExitError asks the process to exit with a specific code, such as the exit code of a container, without printing anything further.

func (ExitError) Error

func (e ExitError) Error() string

Jump to

Keyboard shortcuts

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