Documentation
¶
Index ¶
- Variables
- func Exec(args []string) error
- func ExecCheck(args []string) error
- func Execname(filename string) string
- func Exists(filename string) bool
- func FormatDuration(d time.Duration) string
- func GetComm(pid int) (string, error)
- func GetDurationStamp(t time.Time) string
- func GetPPID(pid int) (int, error)
- func HumanDuration(d *time.Duration) string
- func InitCallback(f func(interface{}, int))
- func IsDir(dirname string) bool
- func Md5sum(filename string) string
- func OpenBrowser(url string) error
- func Path(filename string) string
- func PathExecVerbose(path string, args []string) error
- func PathRun(path string, argv []string) cmd.Status
- func PathRunLog(path string, argv []string, logf *log.LogFlag) cmd.Status
- func PathRunQuiet(pwd string, args []string) cmd.Status
- func PathRunRealtime(pwd string, args []string) cmd.Status
- func PathRunSimple(workingpath string, cmd []string) error
- func RemoveFirstElement(slice []string) (string, []string)
- func Run(argv []string) cmd.Status
- func RunEcho(cmd []string) cmd.Status
- func RunQuiet(args []string) cmd.Status
- func RunRealtime(args []string) cmd.Status
- func RunSimple(cmd []string) error
- func RunStrict(cmd []string) (*cmd.Status, error)
- func RunVerbose(cmd []string) (*cmd.Status, error)
- func RunVerboseOnError(cmd []string) (*cmd.Status, error)
- func Shell() string
- func Sudo(c []string) error
- func SudoRaw(c []string)
- func Terminal() string
- func TestTerminalColor()
- func Unlink(filename string) bool
- func Wget(url string) *bytes.Buffer
- func WgetToFile(filepath string, url string) error
- func Write(filepath string, data string) bool
- func XtermCmd(path string, cmd []string)
- func XtermCmdWait(path string, cmd []string)
Constants ¶
This section is empty.
Variables ¶
var INFO *log.LogFlag
var NOW *log.LogFlag
var RUN *log.LogFlag
var SSH *log.LogFlag
Functions ¶
func FormatDuration ¶ added in v0.22.4
func GetDurationStamp ¶ added in v0.22.4
func InitCallback ¶
func InitCallback(f func(interface{}, int))
func OpenBrowser ¶
openBrowser opens the specified URL in the default browser of the user.
func PathExecVerbose ¶ added in v0.22.26
func PathRun ¶ added in v0.22.5
exec the cmd at a filepath. this does not change the working directory sets the exec dir if it's not an empty string combines stdout and stderr echo's output (otherwise use PathRunQuiet() this is basically the exact example from the go-cmd/cmd devs where the have rocked out a proper smart read on both filehandles https://dave.cheney.net/2013/04/30/curious-channels
func PathRunLog ¶ added in v0.22.6
the actual wrapper around go-cmd/cmd adds a log Flag so that echo to stdout can be enabled/disabled
func PathRunQuiet ¶ added in v0.22.5
uses the 'log' package to disable echo to STDOUT only echos if you enable the shell.INFO log flag
func PathRunRealtime ¶ added in v0.22.7
echos twice a second if anything sends to STDOUT or STDERR not great, but it's really just for watching things run in real time anyway TODO: fix \r handling for things like git-clone so the terminal doesn't have to do a \n newline each time. TODO: add timeouts and status of things hanging around forever
func PathRunSimple ¶ added in v0.22.5
func RemoveFirstElement ¶
this is stuff from a long time ago that there must be a replacement for
func Run ¶
shortcut, sends a blank value for pwd which means the exec Dir is not set echos output (otherwise use RunQuiet)
func RunQuiet ¶ added in v0.22.11
uses the 'log' package to disable echo to STDOUT only echos if you enable the shell.INFO log flag
func RunRealtime ¶ added in v0.22.9
send blank path == use current golang working directory
func RunSimple ¶ added in v0.22.5
run interactively. output from the cmd is in real time shows all the output. For example, 'ping -n localhost' shows the output like you would expect to see
func RunVerboseOnError ¶ added in v0.22.24
func Terminal ¶
func Terminal() string
returns a string of the xterm the user is using for example, "xterm" or "mate-terminal"
func TestTerminalColor ¶
func TestTerminalColor()
what genius figured this out? originally from github.com/dimasma0305/GoFetch
func WgetToFile ¶
func Write ¶
write out a file. Always be nice and end with '\n' if you are here and want to complain about ending in '\n' then you probably aren't going to like lots of things in this package. I will quote the evilwm man page:
BUGS: The author's idea of friendly may differ to that of many other people.
func XtermCmdWait ¶
runs an xterm waits until xterm exits
Types ¶
This section is empty.