serveDevToolsWithArgs method
Wraps serveDevTools arguments
parsed, as from the command line.
For more information on handler
, see serveDevTools.
Implementation
// Note: this method is used in google3 as well as by DevTools' main method.
Future<HttpServer?> serveDevToolsWithArgs(
List<String> arguments, {
shelf.Handler? handler,
String? customDevToolsPath,
}) async {
ArgResults args;
final verbose = arguments.contains('-v') || arguments.contains('--verbose');
final argParser = buildArgParser(verbose: verbose);
try {
args = argParser.parse(arguments);
} on FormatException catch (e) {
print(e.message);
print('');
_printUsage(argParser);
return null;
}
return await _serveDevToolsWithArgs(
args,
verbose,
handler: handler,
customDevToolsPath: customDevToolsPath,
);
}