parse

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	Type ElementType
	Data []string
}

func (Element) String

func (e Element) String() string

type ElementType

type ElementType uint8
const (
	// ElementTypeLongFlagPair represents a longform flag with a value directly
	// attached by use of an equals ('=') character.
	ElementTypeLongFlagPair ElementType = iota

	// ElementTypeLongFlagSolo represents a longform flag that did not have a value
	// directly attached by use of an equals ('=') character.
	ElementTypeLongFlagSolo

	// ElementTypeShortBlockSolo represents a group of one or more characters
	// following a single dash ('-') character with no value directly attached via
	// an equals ('=') character.
	ElementTypeShortBlockSolo

	// ElementTypeShortBlockPair represents a group of one or more characters
	// following a single dash ('-') character with a value directly attached via
	// an equals ('=') character.
	ElementTypeShortBlockPair

	// ElementTypePlainText represents a plain-text argument that has no flag
	// indicators
	ElementTypePlainText

	ElementTypeBoundary

	ElementTypeEnd
)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(e emit.Emitter) Parser

func (*Parser) Next

func (p *Parser) Next() Element

Jump to

Keyboard shortcuts

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