cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 19 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 implements the native-agent-api command line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvironMap

func EnvironMap(pairs []string) map[string]string

EnvironMap converts os.Environ() style "KEY=value" pairs into a map.

func Run

func Run(ctx context.Context, env Env) int

Run executes the command in env.Args (without the program name) and returns an exit code.

Types

type Env

type Env struct {
	Args []string
	// Environ is the process environment as a map (see EnvironMap).
	Environ map[string]string
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

Env abstracts the process environment so Run is testable.

func OSEnv

func OSEnv() Env

OSEnv returns the real process environment.

Jump to

Keyboard shortcuts

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