args

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Arguments []Argument `(@@|`
	// contains filtered or unexported fields
}

Args is both used as the grammar and the tree representation of the abstract syntactic structure of the command-line arguments.

func Parse

func Parse(t text.Text) (Args, error)

Parse returns the AST of the command-line arguments.

func (*Args) Bind

func (a *Args) Bind(i interface{})

Bind binds the fields of the given struct with matching argument values.

type Argument

type Argument struct {
	Identifier string `@('-'|Let|Num)+`
	Value      Value  `@@?`
}

type Value

type Value struct {
	Assignment string `@'='`
	String     string `@(Let|Num|Pun|Sym|Sep)+`
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL