diff options
-rw-r--r-- | src/Configuration.cpp | 10 | ||||
-rw-r--r-- | tests/ingen_bench.cpp | 12 | ||||
-rw-r--r-- | tests/ingen_test.cpp | 23 |
3 files changed, 18 insertions, 27 deletions
diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 99675c7b..ac2b374b 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -121,10 +121,10 @@ Configuration::variable_string(LV2_URID type) const void Configuration::print_usage(const std::string& program, std::ostream& os) { - os << "Usage: " << program << " [OPTION]... [GRAPH]" << std::endl; - os << _shortdesc << std::endl << std::endl; - os << _desc << std::endl << std::endl; - os << "Options:" << std::endl; + os << "Usage: " << program << " [OPTION]... [GRAPH]\n"; + os << _shortdesc << "\n\n"; + os << _desc << "\n\n"; + os << "Options:\n"; for (const auto& o : _options) { const Option& option = o.second; os << " "; @@ -136,7 +136,7 @@ Configuration::print_usage(const std::string& program, std::ostream& os) os.width(static_cast<std::streamsize>(_max_name_length + 11)); os << std::left; os << (std::string("--") + o.first + variable_string(option.type)); - os << option.desc << std::endl; + os << option.desc << "\n"; } } diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp index 82fae78d..a445bdc0 100644 --- a/tests/ingen_bench.cpp +++ b/tests/ingen_bench.cpp @@ -41,7 +41,7 @@ void ingen_try(bool cond, const char* msg) { if (!cond) { - std::cerr << "ingen: Error: " << msg << std::endl; + std::cerr << "ingen: Error: " << msg << "\n"; world.reset(); exit(EXIT_FAILURE); } @@ -68,7 +68,7 @@ run(int argc, char** argv) ingen::Configuration::SESSION, world->forge().String, Atom()); world->load_configuration(argc, argv); } catch (std::exception& e) { - std::cout << "ingen: " << e.what() << std::endl; + std::cout << "ingen: " << e.what() << "\n"; return EXIT_FAILURE; } @@ -76,9 +76,7 @@ run(int argc, char** argv) const Atom& load = world->conf().option("load"); const Atom& out = world->conf().option("output"); if (!load.is_valid() || !out.is_valid()) { - std::cerr << "Usage: ingen_bench --load START_GRAPH --output OUT_FILE" - << std::endl; - + std::cerr << "Usage: ingen_bench --load START_GRAPH --output OUT_FILE\n"; return EXIT_FAILURE; } @@ -90,7 +88,7 @@ run(int argc, char** argv) if (start_graph.empty()) { std::cerr << "error: initial graph '" << static_cast<const char*>(load.get_body()) - << "' does not exist" << std::endl; + << "' does not exist\n"; return EXIT_FAILURE; } @@ -107,7 +105,7 @@ run(int argc, char** argv) // Load graph if (!world->parser()->parse_file(*world, *world->interface(), start_graph)) { std::cerr << "error: failed to load initial graph " << start_graph - << std::endl; + << "\n"; return EXIT_FAILURE; } diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index b1705dfa..6f7e2588 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -57,7 +57,7 @@ void ingen_try(bool cond, const char* msg) { if (!cond) { - std::cerr << "ingen: Error: " << msg << std::endl; + std::cerr << "ingen: Error: " << msg << "\n"; world.reset(); exit(EXIT_FAILURE); } @@ -80,7 +80,7 @@ run(int argc, char** argv) world = std::make_unique<World>(nullptr, nullptr, nullptr); world->load_configuration(argc, argv); } catch (const std::exception& e) { - std::cerr << "ingen: " << e.what() << std::endl; + std::cerr << "ingen: " << e.what() << "\n"; return EXIT_FAILURE; } @@ -89,8 +89,7 @@ run(int argc, char** argv) const Atom& execute = world->conf().option("execute"); if (!load.is_valid() || !execute.is_valid()) { std::cerr - << "Usage: ingen_test --load START_GRAPH --execute COMMANDS_FILE" - << std::endl; + << "Usage: ingen_test --load START_GRAPH --execute COMMANDS_FILE\n"; return EXIT_FAILURE; } @@ -100,16 +99,12 @@ run(int argc, char** argv) const FilePath run_path = real_file_path(static_cast<const char*>(execute.get_body())); if (load_path.empty()) { - std::cerr << "error: initial graph '" << load_path << "' does not exist" - << std::endl; - + std::cerr << "error: initial graph '" << load_path << "' does not exist\n"; return EXIT_FAILURE; } if (run_path.empty()) { - std::cerr << "error: command file '" << run_path << "' does not exist" - << std::endl; - + std::cerr << "error: command file '" << run_path << "' does not exist\n"; return EXIT_FAILURE; } @@ -125,9 +120,7 @@ run(int argc, char** argv) // Load graph if (!world->parser()->parse_file(*world, *world->interface(), load_path)) { - std::cerr << "error: failed to load initial graph " << load_path - << std::endl; - + std::cerr << "error: failed to load initial graph " << load_path << "\n"; return EXIT_FAILURE; } world->engine()->flush_events(std::chrono::milliseconds(20)); @@ -180,7 +173,7 @@ run(int argc, char** argv) #if 0 const LV2_Atom* atom = forge.atom(); - cerr << "READ " << atom->size << " BYTES" << endl; + cerr << "READ " << atom->size << " BYTES\n"; cerr << sratom_to_turtle( sratom, &world->uri_map().urid_unmap_feature()->urid_unmap, @@ -249,7 +242,7 @@ main(int argc, char** argv) return ingen::test::run(argc, argv); } catch (const std::exception& e) { - std::cerr << "ingen: " << e.what() << std::endl; + std::cerr << "ingen: " << e.what() << "\n"; return EXIT_FAILURE; } } |