cmdtype

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd []string

Cmd is specified by a slice of strings, avoiding ambiguous argument specifications

func ToCmd

func ToCmd(v any) (Cmd, error)

func ToCmds

func ToCmds(incmds any) ([]Cmd, error)

to cmds from any to []cmdtype.Cmd

func (Cmd) Run

func (cmd Cmd) Run(opts CmdRunOptions) error

Run runs a command

type CmdRunOptions

type CmdRunOptions struct {
	RedirectStdin  io.Reader // default os.Stdin
	RedirectStdout io.Writer // default os.Stdout
	RedirectStderr io.Writer // default os.Stderr
	AppendedArgs   []string  // useful for package install append package spec, []string{} or nil for none
	WorkingDir     string    // change working directory, "" for use default, will do subs for it
	DryRun         io.Writer // won't run, only prints command to run to writer, nil for normal run
	DryPrintPrestr string    // prestr for dry run print, appended before every line
}

Jump to

Keyboard shortcuts

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