cmder

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cmder exec cmd and catch the result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result cmd exec result

func Run

func Run(cmdLine string, timeout ...time.Duration) *Result

Run exec cmd and catch the result. Waits for the given command to finish with a timeout. If the command times out, it attempts to kill the process.

func (*Result) Err

func (r *Result) Err() error

Err returns the error log.

func (*Result) String

func (r *Result) String() string

String returns the exec log.

type ShCmd added in v1.1.0

type ShCmd struct {
	// contains filtered or unexported fields
}

func NewShCmd added in v1.1.0

func NewShCmd(cmdLine string) ShCmd

func (ShCmd) Run added in v1.1.0

func (sh ShCmd) Run(timeout ...time.Duration) *Result

func (ShCmd) SetEnv added in v1.1.0

func (cmd ShCmd) SetEnv(env []string) ShCmd

Jump to

Keyboard shortcuts

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