Provide a config generator
- Dominant language
- C++
- Stars
- 34
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
An outline
```
#include
#include
// Create a config template with capitalized VARIABLE_NAMES as placeholders for
// config parameter values
std::string conf_template = R"(
num_devices = NUM_DEVICES;
num_targets = NUM_TARGETS;
capacities_mb = CAPACITIES;
block_sizes_kb = BLOCK_SIZES;
num_slabs = NUM_SLABS;
slab_unit_sizes = {
SLAB_UNIT_SIZES
};
desired_slab_percentages = {
SLAB_PERCENTAGES
};
etc ...
)";
int main() {
// Create a default Config
hermes::Config conf = hermes::InitDefaultConfig();
// Parse command line options and overwrite default Config values with the
// user-supplied values.
// Replace variables in the config template with the values in conf
conf_template = std::regex_replace(conf_template, std::regex("NUM_DEVICES"),
std::to_string(conf.num_devices));
conf_template = std::regex_replace(conf_template, std::regex("NUM_TARGETS"),
std::to_string(conf.num_targets));
// etc.
// Finally, write the final conf_template string to a file. The filename
// should be passed via command line option, with ./hermes.conf as the default
return 0;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start from the issue's proposed config template and the hermes::Config values returned by InitDefaultConfig(). Determine how command-line options should override those values and how the output filename should be selected, including the default ./hermes.conf. Done means a generated configuration file contains the populated template and can be written to the requested path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100