Wilcot Cpp — a C++ library that helps in developing Linux applications.
- Process creation;
- Linux container creation;
- Convenient testing utils;
- Convenient working with filesystem;
- Convenient working with console;
- Streams and ring buffer.
// Create new option parser
wilcot::cli::OptionParser parser;
// Create arguments for options
wilcot::cli::ValueOption<std::string> inputFile("--input");
wilcot::cli::ValueOption<std::string> outputFile("--output");
// Add options to option parser
parser.addOption(inputFile.setArgument("path"));
parser.addOption(outputFile.setArgument("path"));
// Parse arguments passed to main
parser.parse(argc, argv);
// Create new process instance
wilcot::os::Process process;
// Create an array for arguments
std::vector<std::string> arguments;
arguments.push_back("/bin/bash");
// Set path to program and execute arguments
process.setProgram("/bin/bash");
process.setArguments(arguments);
// Start process
process.start();
// Wait for process exit
process.wait();