cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cli builds the cobra command tree. Keeping the tree in a dedicated package (rather than inside cmd/tsuba) makes it testable without spawning a binary.

Index

Constants

This section is empty.

Variables

View Source
var ErrFailed = errors.New("tsuba failed")

ErrFailed is returned by subcommands when the work they were asked to do did not produce the expected result. Execute maps this sentinel to exit code 1. Usage errors (bad flag, missing arg) come back via cobra and map to exit code 2.

Functions

func Execute

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

Execute is the single entry point that cmd/tsuba/main.go calls. Returns a process exit code. Testable from unit tests.

Exit codes:

0 - success
1 - command ran but the work failed (validation error, scaffold refused)
2 - invocation error (bad flag, missing file)

Types

This section is empty.

Jump to

Keyboard shortcuts

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