cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package cli assembles the weg command tree.

Index

Constants

View Source
const (
	// ExitOK indicates success.
	ExitOK = 0
	// ExitError indicates the command ran but failed.
	ExitError = 1
	// ExitUsage indicates the command line itself was invalid.
	ExitUsage = 2
	// ExitCancelled indicates the command was interrupted, following the shell
	// convention of 128 plus the signal number for SIGINT.
	ExitCancelled = 130
)

Exit codes returned by Execute. They follow the convention that 1 is a runtime failure and 2 is a usage error, so scripts can tell "the server said no" apart from "you typed it wrong".

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, args []string, stdout, stderr io.Writer) int

Execute builds the command tree, runs it against args, and returns the process exit code. args excludes the program name.

func Main

func Main(ctx context.Context) int

Main is the entry point used by cmd/weg. It wires the real standard streams and returns the exit code for the caller to pass to os.Exit.

Types

This section is empty.

Directories

Path Synopsis
Package output renders command results in the three formats every weg command supports: human-readable text, JSON and YAML.
Package output renders command results in the three formats every weg command supports: human-readable text, JSON and YAML.

Jump to

Keyboard shortcuts

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