From 5097fd4f50231412e333fb7809f9b032c3f2ba00 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 2 Nov 2016 11:29:01 -0700 Subject: [PATCH] Prettier help in tool (#6637) --- packages/flutter_tools/lib/src/hot.dart | 2 +- .../flutter_tools/lib/src/resident_runner.dart | 5 +++-- packages/flutter_tools/lib/src/run.dart | 16 +++++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/lib/src/hot.dart b/packages/flutter_tools/lib/src/hot.dart index 78438ff093..ac1320ced5 100644 --- a/packages/flutter_tools/lib/src/hot.dart +++ b/packages/flutter_tools/lib/src/hot.dart @@ -549,7 +549,7 @@ class HotRunner extends ResidentRunner { @override void printHelp({ @required bool details }) { - printStatus('To hot reload your app on the fly, press "r" or F5. To restart the app entirely, press "R".', emphasis: true); + printStatus('🔥 To hot reload your app on the fly, press "r" or F5. To restart the app entirely, press "R".', emphasis: true); printStatus('The Observatory debugger and profiler is available at: http://127.0.0.1:$_observatoryPort/'); if (details) { printStatus('To dump the widget hierarchy of the app (debugDumpApp), press "w".'); diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 1932b67e0f..7cc38c6579 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -176,9 +176,10 @@ abstract class ResidentRunner { void setupTerminal() { if (usesTerminalUI) { - if (!logger.quiet) + if (!logger.quiet) { + printStatus(''); printHelp(details: false); - + } terminal.singleCharMode = true; terminal.onCharInput.listen((String code) { processTerminalInput(code); diff --git a/packages/flutter_tools/lib/src/run.dart b/packages/flutter_tools/lib/src/run.dart index 22709ccfb8..4b5ff064e3 100644 --- a/packages/flutter_tools/lib/src/run.dart +++ b/packages/flutter_tools/lib/src/run.dart @@ -262,20 +262,22 @@ class RunAndStayResident extends ResidentRunner { @override void printHelp({ @required bool details }) { - final bool showRestartText = !prebuiltMode && device.supportsRestart && - supportsServiceProtocol; - if (showRestartText) + bool haveDetails = false; + if (!prebuiltMode && device.supportsRestart && supportsServiceProtocol) printStatus('To restart the app, press "r" or F5.'); if (_result.hasObservatory) printStatus('The Observatory debugger and profiler is available at: http://127.0.0.1:${_result.observatoryPort}/'); - if (details) { - if (supportsServiceProtocol) { + if (supportsServiceProtocol) { + haveDetails = true; + if (details) { printStatus('To dump the widget hierarchy of the app (debugDumpApp), press "w".'); printStatus('To dump the rendering tree of the app (debugDumpRenderTree), press "r".'); } - printStatus('To repeat this help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'); - } else { + } + if (haveDetails && !details) { printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'); + } else { + printStatus('To repeat this help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'); } }