commandline

package
v0.0.0-...-9aa2fb4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Unlicense Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoArgumentValue indicates flag has name but no value to provide,
	// example: "--someflag"
	NoArgumentValue interface{} = &struct{}{} // stub object

	// NoArgument indicates the argument should be omitted from console command
	NoArgument = ""
	// NoArgumentNil indicates the argument should be omitted from console command
	NoArgumentNil interface{} // =nil

)

Functions

func ArgumentsCopyTo

func ArgumentsCopyTo(from map[string]interface{}, to map[string]interface{}) map[string]interface{}

ArgumentsCopyTo helps to append commandline arguments from one map to another

func ArgumentsToStringArray

func ArgumentsToStringArray(args map[string]interface{}) []string

ArgumentsToStringArray converts map to an array of command line arguments taking in account NoArgumentValue and NoArgument indicators above

Types

type ExecutablePathProvider

type ExecutablePathProvider interface {
	// Executable returns full path to an executable target file
	Executable() string
}

ExecutablePathProvider wraps class responsible for executable path resolution

type ExplicitExecutablePathString

type ExplicitExecutablePathString struct {
	PathString string
}

func (*ExplicitExecutablePathString) Executable

func (pth *ExplicitExecutablePathString) Executable() string

type ExternalProcess

type ExternalProcess struct {
	// CommandName stores console command name
	CommandName string

	// Arguments stores console command arguments
	Arguments []string

	// WaitForExit set to true tells the Launch()
	// to hold until the process finish it's job
	WaitForExit bool
	// contains filtered or unexported fields
}

ExternalProcess is a helper class wrapping command line execution

func (*ExternalProcess) ClearArguments

func (process *ExternalProcess) ClearArguments()

ClearArguments clears the Arguments list

func (*ExternalProcess) Dispose

func (process *ExternalProcess) Dispose()

Dispose implements integration.LeakyAsset behaviour

func (*ExternalProcess) FullConsoleCommand

func (process *ExternalProcess) FullConsoleCommand() string

FullConsoleCommand returns full console command string

func (*ExternalProcess) IsRunning

func (process *ExternalProcess) IsRunning() bool

IsRunning indicates when ext process is working

func (*ExternalProcess) Launch

func (process *ExternalProcess) Launch(debugOutput bool)

Launch launches external process set the debugOutput true to redirect external process output to your os.Stdout and os.Stderr

func (*ExternalProcess) Stop

func (process *ExternalProcess) Stop() error

Stop interrupts the running process, and waits until it exits properly. It is important that the process be stopped via Stop(), otherwise, it will persist unless explicitly killed.

func (*ExternalProcess) Wait

func (process *ExternalProcess) Wait() error

Jump to

Keyboard shortcuts

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