syscmd

package
v0.0.0-...-83feed8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitStatusOK = "exit status 0"
)

Variables

This section is empty.

Functions

func LogEnabled

func LogEnabled() bool

func LogSwitch

func LogSwitch(on bool)

func NoRunEnabled

func NoRunEnabled() bool

func NoRunSwitch

func NoRunSwitch(on bool)

func RunArgs

func RunArgs(args ...string) (string, string, string, error)

运行一段命令,将入参拆解 Args: cmdline Return: stat stdout errout error

func RunStr

func RunStr(cmdline string) (string, string, string, error)

运行一段命令 Args: cmdline Return: stat stdout errout error

func Which

func Which(s string) (string, error)

查找某个命令的路径 不同平台用不同实现 TODO 目前只支持linux mac

Types

type Error

type Error int
const (
	ErrCmdNotFound Error = 1
)

func (Error) Error

func (me Error) Error() string

Jump to

Keyboard shortcuts

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