Lua: Allow shortening "evaluate-lua" to "L".

This commit is contained in:
Ilari Liusvaara 2013-07-24 13:15:02 +03:00
parent 6d6570ecea
commit 7186e515ff
3 changed files with 22 additions and 2 deletions

View file

@ -1384,6 +1384,14 @@ evaluate-lua <luacode>
Run Lua code <luacode> using built-in Lua interpretter.
\end_layout
\begin_layout Subsubsection
L <luacode>
\end_layout
\begin_layout Standard
Synonym for evaluate-lua.
\end_layout
\begin_layout Subsubsection
run-lua <script>
\end_layout

View file

@ -673,11 +673,15 @@ Only available if lua support is compiled in.
Run Lua code <luacode> using built-in Lua interpretter.
6.9.2 run-lua <script>
6.9.2 L <luacode>
Synonym for evaluate-lua.
6.9.3 run-lua <script>
Run specified lua file using built-in Lua interpretter.
6.9.3 reset-lua
6.9.4 reset-lua
Clear the Lua VM state and restore to factory defaults.

View file

@ -530,6 +530,14 @@ namespace
do_eval_lua(args);
});
function_ptr_command<const std::string&> evaluate_lua2("L", "Evaluate expression in Lua VM",
"Syntax: evaluate-lua <expression>\nEvaluates <expression> in Lua VM.\n",
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
if(args == "")
throw std::runtime_error("Expected expression to evaluate");
do_eval_lua(args);
});
function_ptr_command<arg_filename> run_lua("run-lua", "Run Lua script in Lua VM",
"Syntax: run-lua <file>\nRuns <file> in Lua VM.\n",
[](arg_filename args) throw(std::bad_alloc, std::runtime_error)