Documentation ¶
Index ¶
- Variables
- func Cat(filename string) string
- func Dir(dirname string) bool
- 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 InitCallback(f func(interface{}, int))
- func IsDir(dirname string) bool
- func Md5sum(filename string) string
- func Mkdir(dir string) bool
- func OpenBrowser(url string) error
- func Path(filename string) string
- func PathRun(path string, args []string) cmd.Status
- func PathRunQuiet(pwd string, args []string) cmd.Status
- func PathRunSimple(workingpath string, cmd []string) error
- func Quiet(q bool)
- func RemoveFirstElement(slice []string) (string, []string)
- func Run(args []string) cmd.Status
- func RunHttpOut(cmd []string, w http.ResponseWriter, r *http.Request) error
- func RunPathHttpOut(path string, cmd []string, w http.ResponseWriter, r *http.Request) error
- func RunSimple(cmd []string) error
- func RunTest()
- func Shell() 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 XtermCmdBash(path string, cmd []string)
- func XtermCmdWait(path string, cmd []string)
- type File
- type OldShell
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func OpenBrowser ¶
openBrowser opens the specified URL in the default browser of the user.
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 PathRunQuiet ¶ added in v0.22.5
absolutely doesn't echo anything
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 RunHttpOut ¶ added in v0.22.4
func RunPathHttpOut ¶ added in v0.22.4
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 RunTest ¶ added in v0.22.5
func RunTest()
run these to see confirm the sytem behaves as expected
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 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 XtermCmd ¶
spawns an xterm with something you can run at a command line
func XtermCmdBash ¶
spawns an xterm with something you can run at a command line then executes bash
Types ¶
type File ¶
type OldShell ¶
type OldShell struct { Cmdline string Process *exec.Cmd Done bool Quiet bool Fail bool Error error Buffer *bytes.Buffer // which names are really better here? // for now I init them both to test out // how the code looks and feels STDOUT *File STDERR *File Stdout *File Stderr *File }
early code playground