https://github.com/udovin/wilcotcpp
A C++ library that helps in developing Linux applications.
https://github.com/udovin/wilcotcpp
linux-namespaces option-parser
Last synced: 11 months ago
JSON representation
A C++ library that helps in developing Linux applications.
- Host: GitHub
- URL: https://github.com/udovin/wilcotcpp
- Owner: udovin
- License: mit
- Created: 2018-08-02T20:00:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-16T17:44:01.000Z (almost 7 years ago)
- Last Synced: 2025-01-06T13:37:21.121Z (about 1 year ago)
- Topics: linux-namespaces, option-parser
- Language: C++
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Wilcot Cpp
Wilcot Cpp — a C++ library that helps in developing Linux applications.
## What's supported?
* Process creation;
* Linux container creation;
* Convenient testing utils;
* Convenient working with filesystem;
* Convenient working with console;
* Streams and ring buffer.
## Examples
### Options parsing
```cpp
// Create new option parser
wilcot::cli::OptionParser parser;
// Create arguments for options
wilcot::cli::ValueOption inputFile("--input");
wilcot::cli::ValueOption 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);
```
### Process creation
```cpp
// Create new process instance
wilcot::os::Process process;
// Create an array for arguments
std::vector 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();
```