File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ Usage: webdev serve [arguments] [<directory>[:<port>]]...
5858 (defaults to "localhost")
5959
6060
61- --launch-in-chrome Automatically launches your application in
61+ --[no-] launch-in-chrome Automatically launches your application in
6262 Chrome with the debug port open. Use
63- chrome-debug-port to specify a specific port.
63+ chrome-debug-port to specify a specific port
64+ to attach to an already running chrome
65+ instance instead.
6466
6567 --log-requests Enables logging for each request to the
6668 server.
Original file line number Diff line number Diff line change @@ -148,9 +148,14 @@ class Configuration {
148148 ? argResults[hostnameFlag] as String
149149 : defaultConfiguration.hostname;
150150
151- var launchInChrome = argResults.options.contains (launchInChromeFlag)
151+ var launchInChrome = argResults.options.contains (launchInChromeFlag) &&
152+ argResults.wasParsed (launchInChromeFlag)
152153 ? argResults[launchInChromeFlag] as bool
153- : defaultConfiguration.launchInChrome;
154+ // We want to default to launch chrome if the user provides just --debug
155+ // and not --chrome-debug-port.
156+ : debug && ! argResults.wasParsed (chromeDebugPortFlag)
157+ ? true
158+ : defaultConfiguration.launchInChrome;
154159
155160 var logRequests = argResults.options.contains (logRequestsFlag)
156161 ? argResults[logRequestsFlag] as bool
@@ -188,8 +193,8 @@ class Configuration {
188193
189194 if (debug && chromeDebugPort == 0 && ! launchInChrome) {
190195 throw InvalidConfiguration (
191- 'Must either use --$chromeDebugPortFlag or --$launchInChrome with '
192- '--$debugFlag .' );
196+ 'Must either use --$chromeDebugPortFlag or --$launchInChromeFlag '
197+ 'with --$debugFlag .' );
193198 }
194199
195200 return Configuration (
Original file line number Diff line number Diff line change @@ -76,10 +76,9 @@ refresh: Performs a full page refresh.
7676 hide: true )
7777 ..addFlag (hotReloadFlag, negatable: false , hide: true )
7878 ..addFlag (launchInChromeFlag,
79- negatable: false ,
8079 help: 'Automatically launches your application in Chrome with the '
8180 'debug port open. Use $chromeDebugPortFlag to specify a specific '
82- 'port.' )
81+ 'port to attach to an already running chrome instance instead .' )
8382 ..addFlag (liveReloadFlag,
8483 negatable: false ,
8584 help:
You can’t perform that action at this time.
0 commit comments