gluaquestion

package module
v0.0.0-...-311437c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: MIT Imports: 6 Imported by: 3

README

gluaquestion

A library of gopher-lua to prompt the user for input.

Installation

go get github.com/kohkimakimoto/gluaquestion

API

  • question.ask(text)
  • question.secret(text)

Usage

package main

import (
    "github.com/yuin/gopher-lua"
    "github.com/kohkimakimoto/gluaquestion"
)

func main() {
    L := lua.NewState()
    defer L.Close()

    L.PreloadModule("question", gluaquestion.Loader)
    if err := L.DoString(`
local question = require("question")

local name = question.ask("What's your name: ")
print("hello " .. name)

-- What's your name: kohki
-- hello kohki

`); err != nil {
        panic(err)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is glua module loader.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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