programs

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 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 programs runs each program doit starts by its argv, within a bound. Every argv is built in doit's code from doit's own values, so a field read from elsewhere fills one argument and never adds one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShellJoin

func ShellJoin(argv []string) string

ShellJoin quotes each argument that a shell would split, so the command reads as it ran.

func SplitWords

func SplitWords(text string) ([]string, error)

SplitWords splits text into words as Python's shlex.split does. Single quotes keep every character. Inside double quotes a backslash escapes only a double quote or a backslash, and stays before any other character.

Types

type Failed

type Failed struct {
	Message  string
	TimedOut bool
	// Exited is a program that ran and exited non-zero, with ExitCode.
	Exited   bool
	ExitCode int
}

Failed is a program that was missing, timed out or exited non-zero. One that timed out may have done its work.

func (*Failed) Error

func (f *Failed) Error() string

type Program

type Program struct {
	Argv  []string
	Bound time.Duration
}

Program is one argv that doit starts, with how long it may take.

func (Program) Run

func (p Program) Run(ctx context.Context) (string, error)

Run is the program's stdout, or a Failed naming what went wrong.

func (Program) RunShowing

func (p Program) RunShowing(ctx context.Context, out io.Writer) error

RunShowing runs the program with its output on out, as a card printed inline, rather than kept.

Jump to

Keyboard shortcuts

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