Skip to content
Snippets Groups Projects
Commit e9a9170b authored by Martin Wölzer's avatar Martin Wölzer
Browse files

examples/sub_parser_example.cpp: get rid of std::endl

parent f403d537
No related branches found
No related tags found
1 merge request!24Create release v.0.6.0
......@@ -132,14 +132,15 @@ class cli_parser_t : public clapp::parser::basic_main_parser_t {
clapp::value::found_func_t::ret_t print_version_and_exit(
const std::string & /*option*/) {
std::cout << clapp::build_info::build_info_string << std::endl;
std::cout << clapp::build_info::build_info_string << "\n";
return clapp::value::exit_t::exit(EXIT_SUCCESS);
}
clapp::value::found_func_t::ret_t print_not_implemented_and_exit(
const std::string &option) {
std::cout << "Option '" << option
<< "' currently not implemented: don't use it!" << std::endl;
<< "' currently not implemented: don't use it!"
<< "\n";
return clapp::value::exit_t::exit(EXIT_FAILURE);
}
......@@ -217,23 +218,27 @@ int main(int argc, char *argv[]) {
}
if (parser->first) { // if the first sub-parser is selected
std::cout << "first parser active" << std::endl;
std::cout << "first parser active"
<< "\n";
process_first(parser->first);
} else {
std::cout << "first parser not active" << std::endl;
std::cout << "first parser not active"
<< "\n";
}
if (parser->second) { // if the first sub-parser is selected
std::cout << "second parser active" << std::endl;
std::cout << "second parser active"
<< "\n";
process_second(parser->second);
} else {
std::cout << "second parser not active" << std::endl;
std::cout << "second parser not active"
<< "\n";
}
} catch (clapp::clapp_exception_t &e) {
std::cout << "Caught ClaPP-Exception: " << e.what() << std::endl;
std::cout << "Caught ClaPP-Exception: " << e.what() << "\n";
return EXIT_FAILURE;
} catch (std::exception &e) {
std::cout << "Caught Exception: " << e.what() << std::endl;
std::cout << "Caught Exception: " << e.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment