diff options
| author | Alexander Gavrilov | 2012-04-01 17:00:25 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-01 17:00:25 +0400 |
| commit | edd63080b5d9df2a1e717899cf88bc8b45468186 (patch) | |
| tree | 1854fca8b6ebaef5a135c0fb569a0b6922842bd8 /library/LuaTools.cpp | |
| parent | afe4eba957dadf219ff4b4d2a3aa89b773f44fdd (diff) | |
| download | dfhack-edd63080b5d9df2a1e717899cf88bc8b45468186.tar.gz dfhack-edd63080b5d9df2a1e717899cf88bc8b45468186.tar.bz2 dfhack-edd63080b5d9df2a1e717899cf88bc8b45468186.tar.xz | |
Only print the shortcut help once in the lua interactive mode.
Diffstat (limited to 'library/LuaTools.cpp')
| -rw-r--r-- | library/LuaTools.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/library/LuaTools.cpp b/library/LuaTools.cpp index 8b3fa037..77eda125 100644 --- a/library/LuaTools.cpp +++ b/library/LuaTools.cpp @@ -225,11 +225,16 @@ bool DFHack::Lua::InterpreterLoop(color_ostream &out, lua_State *state, DFHack::CommandHistory hist; hist.load(hfile); - out.print("Type quit to exit interactive lua interpreter.\n" - "Shortcuts:\n" - " '= foo' => '_1,_2,... = foo'\n" - " '! foo' => 'print(foo)'\n" - "Both assign the first result to '_'\n"); + out.print("Type quit to exit interactive lua interpreter.\n"); + + static bool print_banner = true; + if (print_banner) { + out.print("Shortcuts:\n" + " '= foo' => '_1,_2,... = foo'\n" + " '! foo' => 'print(foo)'\n" + "Both save the first result as '_'.\n"); + print_banner = false; + } Console &con = static_cast<Console&>(out); @@ -305,7 +310,7 @@ bool DFHack::Lua::InterpreterLoop(color_ostream &out, lua_State *state, { if (!load_with_env(out, state, curline, base)) continue; - if (!SafeCall(out, state, 0, LUA_MULTRET)) + if (!SafeCall(out, state, 0, 0)) continue; } } |
