Files
dl_old/project/dl_console/main.cpp
T
2026-04-08 18:43:02 +08:00

41 lines
926 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <dl.h>
using namespace dl;
int main(int argc, char* argv[])
{
Engine::Init();
//while (true)
//{
// log_msg("{:x}", UidGenerator::CreateUid());
//}
log_info("程序名: {}", CodeCvt::MultiByteToUtf8(argv[0]));
log_info("参数总数: {}", argc - 1);
for (int i = 1; i < argc; i++) {
log_info("参数{}: {}", i, CodeCvt::MultiByteToUtf8(argv[i]));
}
std::string lua_file;
#ifndef NDEBUG
//lua_file = "批量小写文件名.lua";
//lua_file = "批量清除图片透明色.lua";
//lua_file = "窗口示例.lua";
//lua_file = "批量缩放图片.lua";
//lua_file = "批量转换图片为PNG格式.lua";
//lua_file = "压缩文件(lz4).lua";
//lua_file = "解压文件(lz4).lua";
lua_file = "批量计算文件哈希.lua";
#else
if(argc > 1)
lua_file = CodeCvt::MultiByteToUtf8(argv[1]);
#endif
if (!lua_file.empty())
{
g_lua->DoFile(lua_file);
}
Engine::Release();
return 0;
}