[yul-phaser] Phaser: List all available values of enum options in --help

This commit is contained in:
Kamil Śliwak 2020-03-20 18:14:28 +01:00
parent e19d8d1fa3
commit 424edecd21

View File

@ -437,8 +437,15 @@ Phaser::CommandLineDescription Phaser::buildCommandLineDescription()
(
"mode",
po::value<PhaserMode>()->value_name("<NAME>")->default_value(PhaserMode::RunAlgorithm),
(
"Mode of operation. The default is to run the algorithm but you can also tell phaser "
"to do something else with its parameters, e.g. just print the optimised programs and exit."
"to do something else with its parameters, e.g. just print the optimised programs and exit.\n"
"\n"
"AVAILABLE MODES:\n"
"* " + toString(PhaserMode::RunAlgorithm) + "\n" +
"* " + toString(PhaserMode::PrintOptimisedPrograms) + "\n" +
"* " + toString(PhaserMode::PrintOptimisedASTs)
).c_str()
)
;
keywordDescription.add(generalDescription);
@ -448,7 +455,14 @@ Phaser::CommandLineDescription Phaser::buildCommandLineDescription()
(
"algorithm",
po::value<Algorithm>()->value_name("<NAME>")->default_value(Algorithm::GEWEP),
"Algorithm"
(
"Algorithm\n"
"\n"
"AVAILABLE ALGORITHMS:\n"
"* " + toString(Algorithm::GEWEP) + "\n" +
"* " + toString(Algorithm::Classic) + "\n" +
"* " + toString(Algorithm::Random)
).c_str()
)
(
"no-randomise-duplicates",
@ -470,7 +484,14 @@ Phaser::CommandLineDescription Phaser::buildCommandLineDescription()
(
"crossover",
po::value<CrossoverChoice>()->value_name("<NAME>")->default_value(CrossoverChoice::SinglePoint),
"Type of the crossover operator to use."
(
"Type of the crossover operator to use.\n"
"\n"
"AVAILABLE CROSSOVER OPERATORS:\n"
"* " + toString(CrossoverChoice::SinglePoint) + "\n" +
"* " + toString(CrossoverChoice::TwoPoint) + "\n" +
"* " + toString(CrossoverChoice::Uniform)
).c_str()
)
(
"uniform-crossover-swap-chance",
@ -590,13 +611,27 @@ Phaser::CommandLineDescription Phaser::buildCommandLineDescription()
(
"metric",
po::value<MetricChoice>()->value_name("<NAME>")->default_value(MetricChoice::RelativeCodeSize),
"Metric used to evaluate the fitness of a chromosome."
(
"Metric used to evaluate the fitness of a chromosome.\n"
"\n"
"AVAILABLE METRICS:\n"
"* " + toString(MetricChoice::CodeSize) + "\n" +
"* " + toString(MetricChoice::RelativeCodeSize)
).c_str()
)
(
"metric-aggregator",
po::value<MetricAggregatorChoice>()->value_name("<NAME>")->default_value(MetricAggregatorChoice::Average),
(
"Operator used to combine multiple fitness metric obtained by evaluating a chromosome "
"separately for each input program."
"separately for each input program.\n"
"\n"
"AVAILABLE METRIC AGGREGATORS:\n"
"* " + toString(MetricAggregatorChoice::Average) + "\n" +
"* " + toString(MetricAggregatorChoice::Sum) + "\n" +
"* " + toString(MetricAggregatorChoice::Maximum) + "\n" +
"* " + toString(MetricAggregatorChoice::Minimum)
).c_str()
)
(
"relative-metric-scale",