Open qfettes opened 5 years ago
Blow is copied from source code, i wish it could help
misc::IniFile ini_file(m2s_context_config);
for (int index = 0; ; index++)
{
// Stop if section does not exist
std::string section = misc::fmt("Context %d", index);
if (!ini_file.Exists(section))
break;
// Load
std::string exe = ini_file.ReadString(section, "Exe");
std::string current_directory = ini_file.ReadString(section, "Cwd");
std::string stdin_file_name = ini_file.ReadString(section, "Stdin");
std::string stdout_file_name = ini_file.ReadString(section, "Stdout");
// Arguments
std::vector<std::string> arguments;
std::string args_str = ini_file.ReadString(section, "Args");
misc::StringTokenize(args_str, arguments);
arguments.insert(arguments.begin(), exe);
// Environment variables
std::vector<std::string> environment;
std::string env_str = ini_file.ReadString(section, "Env");
misc::Environment::getFromString(env_str, environment);
// Load program
LoadProgram(arguments,
environment,
current_directory,
stdin_file_name,
stdout_file_name);
}
Hello, as described in the --ctx-config section after running m2s --help, I should be able to use
m2s --ctx-config-help
to get more information on the config file format. However, that command line argument is not implemented. Does anyone have a fix or a description of the config file? It is necessary for me to fully configure the tests.