package exec

import "git.sr.ht/~shulhan/pakakeh.go/lib/os/exec"

Package exec wrap the standar package "os/exec" to simplify calling Run with stdout and stderr.

Index

Functions

func ParseCommandArgs

func ParseCommandArgs(in string) (cmd string, args []string)

ParseCommandArgs parse the input string into command and arguments. This function detect single, double, or back quote on arguments; and escaped spaces using backslash.

func Run

func Run(command string, stdout, stderr io.Writer) (err error)

Run the command and arguments in the string cmd. If stdout or stderr is nil, it will default to os.Stdout and/or os.Stderr.

Source Files

exec.go

Version
v0.60.0 (latest)
Published
Feb 1, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
14 minutes ago

Tools for package owners.