From 536f06176519072011aebe0d9b4b5b75e1691f67 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Apr 2017 18:58:02 +0200 Subject: [PATCH] "using namespace std" considered harmful --- src/nix/repl.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 78d973ba8..964bb85eb 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -19,8 +19,6 @@ namespace nix { -using namespace std; - #define ESC_RED "\033[31m" #define ESC_GRE "\033[32m" #define ESC_YEL "\033[33m" @@ -70,7 +68,8 @@ struct NixRepl void printHelp() { - cout << "Usage: nix-repl [--help] [--version] [-I path] paths...\n" + std::cout + << "Usage: nix-repl [--help] [--version] [-I path] paths...\n" << "\n" << "nix-repl is a simple read-eval-print loop (REPL) for the Nix package manager.\n" << "\n" @@ -97,8 +96,7 @@ void printHelp() << " If an element of paths starts with http:// or https://, it is interpreted\n" << " as the URL of a tarball that will be downloaded and unpacked to a temporary\n" << " location. The tarball must include a single top-level directory containing\n" - << " at least a file named default.nix.\n" - << flush; + << " at least a file named default.nix.\n"; } @@ -351,7 +349,8 @@ bool NixRepl::processLine(string line) } if (command == ":?" || command == ":help") { - cout << "The following commands are available:\n" + std::cout + << "The following commands are available:\n" << "\n" << " Evaluate and print expression\n" << " = Bind expression to variable\n"