cmdline

package
v1.12.8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOF                               = errors.New("end of file")
	ErrUnsupportedFeatureSubCmd       = errors.New("unsupported feature: sub command")
	ErrUnsupportedFeatureMultiCmds    = errors.New("unsupported feature: multi commands")
	ErrInvalidEscapeChar              = errors.New("invalid escape char")
	ErrIncompleteStringExpectQuot     = errors.New("incomplete string, expect \"")
	ErrIncompleteStringExpectSquot    = errors.New("incomplete string, expect '")
	ErrIncompleteStringExpectBacktick = errors.New("incomplete string, expect ` or |")
)

Functions

func Find

func Find(str string, typeMask uint32) (n int)

func Skip

func Skip(str string, typeMask uint32) string

Types

type Parser

type Parser struct {
	ExecSub func(code string) (string, error)
	Escape  func(c byte) string
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) ParseCmd

func (p *Parser) ParseCmd(cmdline string) (cmd []string, err error)

func (*Parser) ParseCode

func (p *Parser) ParseCode(code string) (cmd []string, codeNext string, err error)

Jump to

Keyboard shortcuts

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