README

gluaflag

gluaflag is a flag module for gopher-lua

Expand ▾ Collapse ▴

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