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

Unified Diff: sky/tools/debugger/prompt/prompt.cc

Issue 678833004: Slight simplification to prompt code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: remove out of date instructions Created 6 years, 2 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 | « no previous file | sky/tools/skydb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/debugger/prompt/prompt.cc
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc
index 6bcc464b34635acb05918c62df7395d43368cc04..b8007a782763e4c537cbfe62541656735f874aac 100644
--- a/sky/tools/debugger/prompt/prompt.cc
+++ b/sky/tools/debugger/prompt/prompt.cc
@@ -61,7 +61,7 @@ class Prompt : public mojo::ApplicationDelegate {
}
bool ExecuteCommand(const std::string& command) {
- if (command == "help") {
+ if (command == "help" || command == "h") {
PrintHelp();
return true;
}
@@ -69,7 +69,7 @@ class Prompt : public mojo::ApplicationDelegate {
ToggleTracing();
return true;
}
- if (command == "reload") {
+ if (command == "reload" || command == "r") {
Reload();
return true;
}
@@ -77,16 +77,12 @@ class Prompt : public mojo::ApplicationDelegate {
Inspect();
return true;
}
+ if (command == "quit" || command == "q") {
+ Quit();
+ return true;
+ }
if (command.size() == 1) {
- char c = command[0];
- if (c == 'h')
- PrintHelp();
- else if (c == 'q')
- Quit();
- else if (c == 'r')
- Reload();
- else
- std::cout << "Unknown command: " << c << std::endl;
+ std::cout << "Unknown command: " << command << std::endl;
return true;
}
return false;
@@ -119,7 +115,7 @@ class Prompt : public mojo::ApplicationDelegate {
<< " trace -- Capture a trace" << std::endl
<< " reload -- Reload the current page" << std::endl
<< " inspect -- Inspect the current page" << std::endl
- << " q -- Quit" << std::endl;
+ << " quit -- Quit" << std::endl;
}
void Reload() {
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698