docli: github.com/celicoo/docli/pkg/args Index | Files

package args

import "github.com/celicoo/docli/pkg/args"

Index

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() (a 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-08-25. Refresh now. Tools for package owners.