gluaflag

package
Version: v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: CC0-1.0, MIT Imports: 10 Imported by: 0

README

gluaflag

gluaflag is a flag module for gopher-lua

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserDataType = fmt.Errorf("Expected gluaflag userdata")

UserDataTypeError is returned when it is not a flag userdata received

Functions

func Loader

func Loader(L *lua.LState) int

Loader is used for preloading the module

func New

func New(L *lua.LState, name string) *lua.LUserData

New returns a new flagset userdata

func Parse

func Parse(L *lua.LState, ud *lua.LUserData, args []string) (*lua.LTable, error)

Parse the command line parameters

Types

type FlagSet

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

FlagSet is the background userdata component

func (*FlagSet) ArgDefaults

func (fs *FlagSet) ArgDefaults() string

ArgDefaults returns the flagsets help string for the possitional arguments

func (*FlagSet) Compgen

func (fs *FlagSet) Compgen(L *lua.LState, compCWords int, compWords []string) []string

Compgen returns a string with possible options for the flag

func (*FlagSet) FlagDefaults

func (fs *FlagSet) FlagDefaults() string

FlagDefaults returns the flagsets help string for the flags

func (*FlagSet) ShortUsage

func (fs *FlagSet) ShortUsage() string

ShortUsage returns the usage string for a flagset

func (*FlagSet) Usage

func (fs *FlagSet) Usage() string

Usage returns the usage message for the flag set

Jump to

Keyboard shortcuts

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