Added new option --parentheses=full to make parsing the output easier.
This commit is contained in:
15
app/main.cpp
15
app/main.cpp
@@ -20,6 +20,7 @@ int main(int argc, char **argv)
|
||||
("simplify,s", po::bool_switch(&context.performSimplification), "Simplify the output")
|
||||
("complete,c", po::bool_switch(&context.performCompletion), "Perform completion")
|
||||
("color", po::value<std::string>()->default_value("auto"), "Colorize output (always, never, auto)")
|
||||
("parentheses", po::value<std::string>()->default_value("normal"), "Parenthesis style (normal, full)")
|
||||
("log-priority,p", po::value<std::string>()->default_value("warning"), "Log messages starting from this priority (debug, info, warning, error)");
|
||||
|
||||
po::positional_options_description positionalOptionsDescription;
|
||||
@@ -80,6 +81,20 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const auto parenthesisStyle = variablesMap["parentheses"].as<std::string>();
|
||||
|
||||
if (parenthesisStyle == "normal")
|
||||
context.parenthesisStyle = anthem::ast::ParenthesisStyle::Normal;
|
||||
else if (parenthesisStyle == "full")
|
||||
context.parenthesisStyle = anthem::ast::ParenthesisStyle::Full;
|
||||
else
|
||||
{
|
||||
context.logger.log(anthem::output::Priority::Error) << "unknown parenthesis style “" << parenthesisStyle << "”";
|
||||
context.logger.errorStream() << std::endl;
|
||||
printHelp();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const auto logPriorityString = variablesMap["log-priority"].as<std::string>();
|
||||
|
||||
try
|
||||
|
Reference in New Issue
Block a user