From 3d85f637178bbfcc2d6b690f24d392beee2cb2c4 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 29 Oct 2014 12:15:34 -0700 Subject: [PATCH] Slight simplification to prompt code R=abarth@chromium.org Review URL: https://codereview.chromium.org/678833004 --- .../flutter/tools/debugger/prompt/prompt.cc | 20 ++++++++----------- engine/src/flutter/tools/skydb | 4 ---- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/engine/src/flutter/tools/debugger/prompt/prompt.cc b/engine/src/flutter/tools/debugger/prompt/prompt.cc index 6bcc464b34..b8007a7827 100644 --- a/engine/src/flutter/tools/debugger/prompt/prompt.cc +++ b/engine/src/flutter/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() { diff --git a/engine/src/flutter/tools/skydb b/engine/src/flutter/tools/skydb index de74aadbb0..a66cc0e21d 100755 --- a/engine/src/flutter/tools/skydb +++ b/engine/src/flutter/tools/skydb @@ -58,10 +58,6 @@ def main(): if args.gdb: shell_command = ['gdb', '--args'] + shell_command - print "To inspect, include:" - print '' - print "And open:" - print "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898" subprocess.check_call(shell_command)