Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/battor_agent/battor_agent_bin.cc

Issue 1641573003: Revert "tools/battor_agent: Adds a tool to find connected BattOrs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_agent.gyp ('k') | tools/battor_agent/battor_finder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_agent_bin.cc
diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc
index 93036e2fcb9b37a4be51a8cca2b97d2aea950f76..360146dd39d81771ec4d0d8779fa84e99147d973 100644
--- a/tools/battor_agent/battor_agent_bin.cc
+++ b/tools/battor_agent/battor_agent_bin.cc
@@ -19,7 +19,6 @@
#include "base/threading/thread.h"
#include "tools/battor_agent/battor_agent.h"
#include "tools/battor_agent/battor_error.h"
-#include "tools/battor_agent/battor_finder.h"
using std::cout;
using std::endl;
@@ -48,11 +47,12 @@ void PrintSupportsExplicitClockSync() {
cout << battor::BattOrAgent::SupportsExplicitClockSync() << endl;
}
-// Retrieves argument argnum from the argument list, or an empty string if the
-// argument doesn't exist.
+// Retrieves argument argnum from the argument list, printing the usage
+// guidelines and exiting with an error code if the argument doesn't exist.
std::string GetArg(int argnum, int argc, char* argv[]) {
if (argnum >= argc) {
- return std::string();
+ PrintUsage();
+ exit(1);
}
return argv[argnum];
@@ -89,10 +89,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
// Runs the BattOr binary and returns the exit code.
int Run(int argc, char* argv[]) {
std::string cmd = GetArg(1, argc, argv);
- if (cmd.empty()) {
- PrintUsage();
- exit(1);
- }
// SupportsExplicitClockSync doesn't need to use the serial connection, so
// handle it separately.
@@ -102,18 +98,6 @@ class BattOrAgentBin : public BattOrAgent::Listener {
}
std::string path = GetArg(2, argc, argv);
- // If no path is specified, see if we can find a BattOr and use that.
- if (path.empty())
- path = BattOrFinder::FindBattOr();
-
- // If we don't have any BattOr to use, exit.
- if (path.empty()) {
- cout << "Unable to find a BattOr, and no explicit BattOr path was "
- "specified."
- << endl;
- exit(1);
- }
-
SetUp(path);
if (cmd == "StartTracing") {
« no previous file with comments | « tools/battor_agent/battor_agent.gyp ('k') | tools/battor_agent/battor_finder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698