Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: shell/src/Main.cpp

Issue 6271127710072832: No Issue - fix to be conform with std API (Closed)
Patch Set: Created June 11, 2015, 12:57 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 18 matching lines...) Expand all
29 namespace 29 namespace
30 { 30 {
31 void Add(CommandMap& commands, Command* command) 31 void Add(CommandMap& commands, Command* command)
32 { 32 {
33 commands[command->name] = command; 33 commands[command->name] = command;
34 } 34 }
35 35
36 bool ReadCommandLine(std::string& commandLine) 36 bool ReadCommandLine(std::string& commandLine)
37 { 37 {
38 std::cout << "> "; 38 std::cout << "> ";
39 const bool success = std::getline(std::cin, commandLine); 39 const bool success = std::getline(std::cin, commandLine).good();
Felix Dahlke 2015/06/17 19:06:51 Seems standard conform the way it was to me - shou
40 if (!success) 40 if (!success)
41 std::cout << std::endl; 41 std::cout << std::endl;
42 return success; 42 return success;
43 } 43 }
44 44
45 void ParseCommandLine(const std::string& commandLine, std::string& name, 45 void ParseCommandLine(const std::string& commandLine, std::string& name,
46 std::string& arguments) 46 std::string& arguments)
47 { 47 {
48 std::istringstream lineStream(commandLine); 48 std::istringstream lineStream(commandLine);
49 lineStream >> name; 49 lineStream >> name;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 std::cout << error.what() << std::endl; 91 std::cout << error.what() << std::endl;
92 } 92 }
93 } 93 }
94 } 94 }
95 catch (const std::exception& e) 95 catch (const std::exception& e)
96 { 96 {
97 std::cerr << "Exception: " << e.what() << std::endl; 97 std::cerr << "Exception: " << e.what() << std::endl;
98 } 98 }
99 return 0; 99 return 0;
100 } 100 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld