Look up the current key bound to a command. * @tparam string name Name as in cmd-name.h * @treturn string|nil * @function get_command */
| 1289 | * @function get_command |
| 1290 | */ |
| 1291 | static int crawl_get_command(lua_State *ls) |
| 1292 | { |
| 1293 | if (lua_gettop(ls) == 0) |
| 1294 | { |
| 1295 | lua_pushnil(ls); |
| 1296 | return 1; |
| 1297 | } |
| 1298 | |
| 1299 | const command_type cmd = name_to_command(luaL_checkstring(ls, 1)); |
| 1300 | |
| 1301 | string cmd_name = command_to_string(cmd, true); |
| 1302 | if (strcmp(cmd_name.c_str(), "<") == 0) |
| 1303 | cmd_name = "<<"; |
| 1304 | |
| 1305 | lua_pushstring(ls, cmd_name.c_str()); |
| 1306 | return 1; |
| 1307 | } |
| 1308 | |
| 1309 | LUAWRAP(crawl_tutorial_skill, set_tutorial_skill(luaL_checkstring(ls, 1), luaL_safe_checkint(ls, 2))) |
| 1310 | LUAWRAP(crawl_tutorial_hint, tutorial_init_hint(luaL_checkstring(ls, 1))) |
nothing calls this directly
no test coverage detected