summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Hoelz <rob@hoelz.ro>2013-02-19 10:57:51 +0100
committerRob Hoelz <rob@hoelz.ro>2013-02-19 10:57:51 +0100
commit9dd7d88a9c3988d785be86c16544aea3481c864e (patch)
treeb57b4134f28ac6b495506c07009e27a9aac6b4d0
parent4f718e4a3b956028703a89e2f6adeb76dff94bad (diff)
downloadlua-term-9dd7d88a9c3988d785be86c16544aea3481c864e.tar.gz
lua-term-9dd7d88a9c3988d785be86c16544aea3481c864e.tar.bz2
lua-term-9dd7d88a9c3988d785be86c16544aea3481c864e.zip
Add some more documentation
-rw-r--r--README.md98
1 files changed, 98 insertions, 0 deletions
diff --git a/README.md b/README.md
index 280093e..ba4b8e1 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,104 @@ Usage
35 term.cursor.restore() -- restore position 35 term.cursor.restore() -- restore position
36``` 36```
37 37
38`term` Functions
39--------------
40
41Some functions in lua-term take an optional file handle argument; if this is
42not provided, `io.stdout` is used.
43
44### `term.clear([opt_file])`
45
46Clear the terminal's contents.
47
48### `term.cleareol([opt_file])`
49
50Clear from the current cursor position to the end of the current line.
51
52`term.colors` Values
53------------------
54
55The following values are available in `term.colors`:
56
57### Terminal Attributes
58
59 * reset
60 * clear (a synonym for reset)
61 * bright
62 * dim
63 * underscore
64 * blink
65 * reverse
66 * hidden
67
68### Foreground Colors
69
70 * black
71 * red
72 * green
73 * yellow
74 * blue
75 * magenta
76 * cyan
77 * white
78
79### Background Colors
80
81 * onblack
82 * onred
83 * ongreen
84 * onyellow
85 * onblue
86 * onmagenta
87 * oncyan
88 * onwhite
89
90Every value in `term.colors` may be used in several ways:
91
92### As a Function
93
94```lua
95print(colors.red 'hello')
96```
97
98### As a String
99
100```lua
101print(colors.red .. 'hello' .. colors.reset)
102print(colors.red, 'hello', colors.reset)
103```
104
105`term.cursor` Functions
106---------------------
107
108### `term.cursor.goto([opt_file], x, y)`
109
110Place the cursor at (`x`, `y`).
111
112### `term.cursor.goup([opt_file], nlines)`
113
114Moves the cursor up `nlines` lines.
115
116### `term.cursor.godown([opt_file], nlines)`
117
118Moves the cursor down `nlines` lines.
119
120### `term.cursor.goright([opt_file], ncols)`
121
122Moves the cursor right `ncols` columns.
123
124### `term.cursor.goleft([opt_file], ncols)`
125
126Moves the cursor left `ncols` columns.
127
128### `term.cursor.save([opt_file])`
129
130Saves the cursor position.
131
132### `term.cursor.restore([opt_file])`
133
134Restores the cursor position.
135
38Alternatives 136Alternatives
39------------ 137------------
40 138