docli: Index | Files

package args

import ""


Package Files

args.go command.go errors.go grammar.go

type Args Uses

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 Uses

func Parse() Args

Parse returns the AST of the command-line arguments, starting after the program name.

func (*Args) Bind Uses

func (a *Args) Bind(c command)

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

type Argument Uses

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

type InvalidArgumentError Uses

type InvalidArgumentError struct {
    Argument string

func (*InvalidArgumentError) Error Uses

func (i *InvalidArgumentError) Error() string

type Value Uses

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

Package args imports 7 packages (graph) and is imported by 1 packages. Updated 2019-11-26. Refresh now. Tools for package owners.