diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-12 19:53:43 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-20 20:26:18 (GMT) |
commit | a281809384cc19cc9a7d1726b243020b380b9395 (patch) | |
tree | 6fdf2de4e88230d0425acf06a8b459b0177ef978 /Source/cmcmd.cxx | |
parent | 76207b0861478318115d65c2e983f4d88c937724 (diff) | |
download | CMake-a281809384cc19cc9a7d1726b243020b380b9395.zip CMake-a281809384cc19cc9a7d1726b243020b380b9395.tar.gz CMake-a281809384cc19cc9a7d1726b243020b380b9395.tar.bz2 |
Use cmJoin where possible.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6a7dc6e..eb637ef 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -213,27 +213,14 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) // Echo string else if (args[1] == "echo" ) { - unsigned int cc; - const char* space = ""; - for ( cc = 2; cc < args.size(); cc ++ ) - { - std::cout << space << args[cc]; - space = " "; - } - std::cout << std::endl; + std::cout << cmJoin(cmRange(args).advance(2), " ") << std::endl; return 0; } // Echo string no new line else if (args[1] == "echo_append" ) { - unsigned int cc; - const char* space = ""; - for ( cc = 2; cc < args.size(); cc ++ ) - { - std::cout << space << args[cc]; - space = " "; - } + std::cout << cmJoin(cmRange(args).advance(2), " "); return 0; } @@ -1329,12 +1316,7 @@ bool cmcmd::RunCommand(const char* comment, if(verbose) { std::cout << comment << ":\n"; - for(std::vector<std::string>::iterator i = command.begin(); - i != command.end(); ++i) - { - std::cout << *i << " "; - } - std::cout << "\n"; + std::cout << cmJoin(command, " ") << "\n"; } std::string output; int retCode =0; |