shell

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandLine

type CommandLine struct {
	Command string
	Args    []string
}

func NewCommandLine

func NewCommandLine(s string) *CommandLine

func (*CommandLine) Parse

func (this *CommandLine) Parse(s string)

func (*CommandLine) String

func (this *CommandLine) String() string

type Options

type Options struct {
	CheckPath bool
	UseShell  bool
	Timeout   int
}

Options contains ShellCommand configuration

type ShellCommand

type ShellCommand struct {
	CommandStr  string
	Commands    []*CommandLine
	Options     Options
	Description string
	Path        string
	// contains filtered or unexported fields
}

ShellCommand defines how to call a program

func New

func New(useShell bool, cmd string, isExpect bool) *ShellCommand

New creates a ShellCommand

func (*ShellCommand) GetOutputs

func (this *ShellCommand) GetOutputs() []string

func (*ShellCommand) Parse

func (this *ShellCommand) Parse() error

func (*ShellCommand) Set

func (this *ShellCommand) Set(cmd string)

func (*ShellCommand) SetStdIn

func (this *ShellCommand) SetStdIn(reader io.Reader)

func (*ShellCommand) SetWriter

func (this *ShellCommand) SetWriter(writer io.Writer)

func (*ShellCommand) Start

func (this *ShellCommand) Start() error

Run a ShellCommand

func (*ShellCommand) String

func (this *ShellCommand) String() string

func (*ShellCommand) Wait

func (this *ShellCommand) Wait() error

Jump to

Keyboard shortcuts

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