Slight simplification to prompt code
R=abarth@chromium.org Review URL: https://codereview.chromium.org/678833004
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -58,10 +58,6 @@ def main():
|
||||
if args.gdb:
|
||||
shell_command = ['gdb', '--args'] + shell_command
|
||||
|
||||
print "To inspect, include:"
|
||||
print '<link rel="import" href="/sky/framework/inspector/inspector.sky" />'
|
||||
print "And open:"
|
||||
print "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898"
|
||||
subprocess.check_call(shell_command)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user