Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No --ctx-config-help option #71

Open
qfettes opened this issue Oct 30, 2018 · 1 comment
Open

No --ctx-config-help option #71

qfettes opened this issue Oct 30, 2018 · 1 comment

Comments

@qfettes
Copy link

qfettes commented Oct 30, 2018

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.

@ghost
Copy link

ghost commented Jan 23, 2019

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);
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant