entrypoint when called from Lua. returns the names of the generated files
| 1727 | |
| 1728 | // entrypoint when called from Lua. returns the names of the generated files |
| 1729 | static int run(lua_State *L) { |
| 1730 | int argc = lua_gettop(L); |
| 1731 | vector<string> argv; |
| 1732 | |
| 1733 | for (int i = 1; i <= argc; ++i) { |
| 1734 | const char *s = lua_tostring(L, i); |
| 1735 | if (s == NULL) |
| 1736 | luaL_error(L, "all parameters must be strings"); |
| 1737 | argv.push_back(s); |
| 1738 | } |
| 1739 | |
| 1740 | vector<string> files; |
| 1741 | color_ostream *out = Lua::GetOutput(L); |
| 1742 | if (!out) |
| 1743 | out = &Core::getInstance().getConsole(); |
| 1744 | if (CR_OK == do_blueprint(*out, argv, files)) { |
| 1745 | Lua::PushVector(L, files); |
| 1746 | return 1; |
| 1747 | } |
| 1748 | |
| 1749 | return 0; |
| 1750 | } |
| 1751 | |
| 1752 | command_result blueprint(color_ostream &out, vector<string> ¶meters) { |
| 1753 | vector<string> files; |
nothing calls this directly
no test coverage detected