MCPcopy Index your code
hub / github.com/NetHack/NetHack / nhl_get_cmd_key

Function nhl_get_cmd_key

src/nhlua.c:1643–1657  ·  view source on GitHub ↗

returns the visual interpretation of the key bound to an extended command, or the ext cmd name if not bound to any key */ local helpkey = eckey("help"); */

Source from the content-addressed store, hash-verified

1641 or the ext cmd name if not bound to any key */
1642/* local helpkey = eckey("help"); */
1643staticfn int
1644nhl_get_cmd_key(lua_State *L)
1645{
1646 int argc = lua_gettop(L);
1647
1648 if (argc == 1) {
1649 const char *cmd = luaL_checkstring(L, 1);
1650 char *key = cmd_from_ecname(cmd);
1651
1652 lua_pushstring(L, key);
1653 return 1;
1654 }
1655
1656 return 0;
1657}
1658
1659/* add or remove a lua function callback */
1660/* callback("level_enter", "function_name"); */

Callers

nothing calls this directly

Calls 1

cmd_from_ecnameFunction · 0.85

Tested by

no test coverage detected