commands

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DOUBLE_QUOTE = "{DOUBLE_QUOTE}"
View Source
const SPACE_WITHIN_QUOTE = "{SPACE_WITHIN_QUOTE}"

Variables

This section is empty.

Functions

func Create

func Create(plainCommand string) *exec.Cmd

Create creates a command from a single string This allows you to pass parameters which include spaces as commands. You just need to add "double-quotes" around the parameter and it will be treated as one parameter and not be splitted by whitespace.

func Createf

func Createf(format string, args ...interface{}) *exec.Cmd

Createf creates a command from a formatted input string

func ExecuteCommand

func ExecuteCommand(command *exec.Cmd) string

ExecuteCommand executes the command and respects the current verbosity level

func ExecuteCommandForUserInput

func ExecuteCommandForUserInput(cmd *exec.Cmd)

ExecuteCommandForUserInput starts the given command and waits either for command completion or for a user input (ENTER). If there is a user input a Kill-Signal will be sent to the command-process and the execution is continued.

func ExecuteCommandLongRunning

func ExecuteCommandLongRunning(command *exec.Cmd) string

ExecuteCommandLongRunning runs the given command and starts a async spinner to tell the user to be patient

func ExecuteCommandVerbose

func ExecuteCommandVerbose(command *exec.Cmd) string

ExecuteCommandVerbose executes the given command, pipes to stdout and stderr and returns the stdout for further processing, no matter what the verbosity is

func ExecutesSuccessfully

func ExecutesSuccessfully(command *exec.Cmd) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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