internal

package
v0.0.0-...-388ee68 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(command *Command) error

Types

type Command

type Command struct {
	Package, Name string
	FileSet       *token.FileSet
	Writer        io.Writer
	ShortOptions  Fields
	LongOptions   Fields
	Arguments     Fields
}

func ParseCommand

func ParseCommand(packageName string, t *ast.TypeSpec) (*Command, error)

type Commands

type Commands []*Command

func ParseCommands

func ParseCommands(packageName string, tt []*ast.TypeSpec) (Commands, error)

type Field

type Field struct {
	Name         string
	Short        string
	VariableType VariableType
	Type         FieldType
	Default      string
}

type FieldType

type FieldType int8
const (
	FieldOption FieldType = iota + 1
	FieldArgument
)

type Fields

type Fields []*Field

type VariableType

type VariableType int8
const (
	VariableString VariableType = iota + 1
	VariableInt
	VariableInt8
	VariableInt16
	VariableInt32
	VariableInt64
	VariableUint
	VariableUint8
	VariableUint16
	VariableUint32
	VariableUint64
	VariableFloat32
	VariableFloat64
	VariableBool
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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