platforms

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultShell = "bash"

Variables

This section is empty.

Functions

func BuildCommand added in v1.2.0

func BuildCommand(ctx context.Context, interpreter, script string, args []string) (*exec.Cmd, func(), error)

func CleanupCommand

func CleanupCommand(cmd string) (clean string)

func DefaultHomeDir added in v1.2.0

func DefaultHomeDir() string

func GetEditorCmd

func GetEditorCmd() string

func GetTTY added in v1.2.0

func GetTTY() string

func IdentifyShell

func IdentifyShell() string

func IsCompoundStatement added in v1.2.0

func IsCompoundStatement(command string) bool

func KillProcess added in v1.2.0

func KillProcess(cmd *exec.Cmd) error

func NativeHistory added in v1.2.0

func NativeHistory(lineCount int) (<-chan string, error)

func Newline

func Newline(count uint) string

func OpenEditor added in v1.2.0

func OpenEditor(filename string) error

func ShellNameFromExt added in v1.2.0

func ShellNameFromExt(fileExt string) string

func WriteTmpFile

func WriteTmpFile(script string) (string, func(), error)

Types

type AnyShell

type AnyShell struct {
	Name string
}

func (*AnyShell) BuildCommand

func (a *AnyShell) BuildCommand(ctx context.Context, script string, args []string) (*exec.Cmd, func(), error)

func (*AnyShell) FileExtension added in v1.2.0

func (a *AnyShell) FileExtension() string

func (*AnyShell) LineComment added in v1.2.0

func (a *AnyShell) LineComment() string

type Bash

type Bash struct{}

func (*Bash) BuildCommand

func (b *Bash) BuildCommand(ctx context.Context, script string, args []string) (*exec.Cmd, func(), error)

func (*Bash) FileExtension added in v1.2.0

func (b *Bash) FileExtension() string

func (*Bash) History

func (b *Bash) History(lineCount int) <-chan string

func (*Bash) LineComment added in v1.2.0

func (b *Bash) LineComment() string

type Node added in v1.2.0

type Node struct {
	*AnyShell
}

func (*Node) FileExtension added in v1.2.0

func (n *Node) FileExtension() string

func (*Node) LineComment added in v1.2.0

func (n *Node) LineComment() string

type Python added in v1.2.0

type Python struct {
	*AnyShell
}

func (*Python) FileExtension added in v1.2.0

func (p *Python) FileExtension() string

type Ruby added in v1.2.0

type Ruby struct {
	*AnyShell
}

func (*Ruby) FileExtension added in v1.2.0

func (r *Ruby) FileExtension() string

type Shell

type Shell interface {
	BuildCommand(ctx context.Context, script string, args []string) (*exec.Cmd, func(), error)
	FileExtension() string
	LineComment() string
}

func GetPlatformShell added in v1.2.0

func GetPlatformShell(name string) Shell

func GetShell

func GetShell(name string) Shell

Jump to

Keyboard shortcuts

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