runner

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2018 License: MIT Imports: 5 Imported by: 0

README

Command runner

TODO

Documentation

Overview

Package runner(Deprecated) run commands with some convention

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(cmdStr string) (*exec.Cmd, error)

NewCmd can properly split the executable with its arguments TODO: may need to add a context to handle things like using shell or not

func NewCmdWithAutoShell

func NewCmdWithAutoShell(cmdStr string) (*exec.Cmd, error)

NewCmdWithAutoShell automatically use `sh -c` syntax for a small list of executable because most people expect shell expansion i.e. wild chars when using them TODO: test if it really works, current unit test just test the number of arguments

func RunCommand

func RunCommand(cmdStr string) error

Types

type Context

type Context struct {
	AutoShell  bool
	Foreground bool
	Block      bool
	Dry        bool
}

FIXME: this is never used, and it may not be a good idea to use context, since there is context package Context describes how the command should be run i.e. use shell instead of using os/exec, use self defined logic instead of lookup an executable run in background

func NewContext

func NewContext() *Context

NewContext returns a context with convention

Jump to

Keyboard shortcuts

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