Index: head/stand/liblua/lutils.c =================================================================== --- head/stand/liblua/lutils.c +++ head/stand/liblua/lutils.c @@ -97,6 +97,24 @@ } static int +lua_parse(lua_State *L) +{ + int argc, nargc; + char **argv; + + if (parse(&argc, &argv, luaL_checkstring(L, 1)) == 0) { + for (nargc = 0; nargc < argc; ++nargc) { + lua_pushstring(L, argv[nargc]); + } + free(argv); + return nargc; + } + + lua_pushnil(L); + return 1; +} + +static int lua_getchar(lua_State *L) { @@ -325,6 +343,7 @@ REG_SIMPLE(delay), REG_SIMPLE(command), REG_SIMPLE(interpret), + REG_SIMPLE(parse), REG_SIMPLE(getenv), REG_SIMPLE(perform), /* Also registered as the global 'printc' */ Index: head/stand/lua/cli.lua =================================================================== --- head/stand/lua/cli.lua +++ head/stand/lua/cli.lua @@ -94,6 +94,10 @@ end +function cli.execute_unparsed(str) + cli_execute(loader.parse(str)) +end + -- Module exports function cli.boot(...)