beta-0.89.2
[luatex.git] / source / libs / lua52 / lua52-src / doc / lua.1
blob6d3aa8c360a289aa1f62b94c1fc119caedaba7f5
1 .\" $Id: lua.man,v 1.13 2011/11/16 17:16:53 lhf Exp $\r
2 .TH LUA 1 "$Date: 2011/11/16 17:16:53 $"\r
3 .SH NAME\r
4 lua \- Lua interpreter\r
5 .SH SYNOPSIS\r
6 .B lua\r
7 [\r
8 .I options\r
9 ]\r
10 [\r
11 .I script\r
12 [\r
13 .I args\r
14 ]\r
15 ]\r
16 .SH DESCRIPTION\r
17 .B lua\r
18 is the standalone Lua interpreter.\r
19 It loads and executes Lua programs,\r
20 either in textual source form or\r
21 in precompiled binary form.\r
22 (Precompiled binaries are output by\r
23 .BR luac ,\r
24 the Lua compiler.)\r
25 .B lua\r
26 can be used as a batch interpreter and also interactively.\r
27 .LP\r
28 The given\r
29 .I options\r
30 are handled in order and then\r
31 the Lua program in file\r
32 .I script\r
33 is loaded and executed.\r
34 The given\r
35 .I args\r
36 are available to\r
37 .I script\r
38 as strings in a global table named\r
39 .BR arg .\r
40 If no options or arguments are given,\r
41 then\r
42 .B "\-v \-i"\r
43 is assumed when the standard input is a terminal;\r
44 otherwise,\r
45 .B "\-"\r
46 is assumed.\r
47 .LP\r
48 In interactive mode,\r
49 .B lua\r
50 prompts the user,\r
51 reads lines from the standard input,\r
52 and executes them as they are read.\r
53 If a line does not contain a complete statement,\r
54 then a secondary prompt is displayed and\r
55 lines are read until a complete statement is formed or\r
56 a syntax error is found.\r
57 If a line starts with\r
58 .BR '=' ,\r
59 then\r
60 .B lua\r
61 evaluates and displays\r
62 the values of the expressions in the remainder of the line.\r
63 .LP\r
64 At the very start,\r
65 before even handling the command line,\r
66 .B lua\r
67 checks the contents of the environment variables\r
68 .B LUA_INIT_5_2\r
69 or\r
70 .BR LUA_INIT ,\r
71 in that order.\r
72 If the contents is of the form\r
73 .RI '@ filename ',\r
74 then\r
75 .I filename\r
76 is executed.\r
77 Otherwise, the string is assumed to be a Lua statement and is executed.\r
78 .SH OPTIONS\r
79 .TP\r
80 .BI \-e " stat"\r
81 execute statement\r
82 .IR stat .\r
83 .TP\r
84 .B \-i\r
85 enter interactive mode after executing\r
86 .IR script .\r
87 .TP\r
88 .BI \-l " name"\r
89 execute the equivalent of\r
90 .IB name =require(' name ')\r
91 before executing\r
92 .IR script .\r
93 .TP\r
94 .B \-v\r
95 show version information.\r
96 .TP\r
97 .B \-E\r
98 ignore environment variables.\r
99 .TP\r
100 .B \-\-\r
101 stop handling options.\r
102 .TP\r
103 .B \-\r
104 stop handling options and execute the standard input as a file.\r
105 .SH "SEE ALSO"\r
106 .BR luac (1)\r
107 .br\r
108 The documentation at lua.org,\r
109 especially section 7 of the reference manual.\r
110 .SH DIAGNOSTICS\r
111 Error messages should be self explanatory.\r
112 .SH AUTHORS\r
113 R. Ierusalimschy,\r
114 L. H. de Figueiredo,\r
115 W. Celes\r
116 .\" EOF\r