cli

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config, argv0 string, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error)

Run executes the shared gbash CLI frontend with the supplied configuration.

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
	BuiltBy string
}

BuildInfo describes the build metadata rendered by --version.

type Config

type Config struct {
	// Name is the binary name shown in help text, version output, and runtime
	// error messages.
	Name string

	// Build contains the embedded build metadata shown by --version.
	Build *BuildInfo

	// BaseOptions are always applied when constructing the gbash runtime before
	// any CLI filesystem flags are interpreted.
	BaseOptions []gbash.Option

	// TTYDetector overrides how stdin terminal detection is performed. When nil,
	// [Run] uses the default os.File-based detector.
	TTYDetector func(io.Reader) bool
}

Config controls how Run presents and configures the shared gbash CLI frontend.

Jump to

Keyboard shortcuts

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