Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: tools/gardening/lib/src/util.dart

Issue 2908403002: Add a 'bot.dart' executable to the gardening tools. (Closed)
Patch Set: Address comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gardening/bin/status_summary.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 /// Reads the content of [uri] as text. 46 /// Reads the content of [uri] as text.
47 Future<String> readUriAsText(HttpClient client, Uri uri) async { 47 Future<String> readUriAsText(HttpClient client, Uri uri) async {
48 HttpClientRequest request = await client.getUrl(uri); 48 HttpClientRequest request = await client.getUrl(uri);
49 HttpClientResponse response = await request.close(); 49 HttpClientResponse response = await request.close();
50 return await response.transform(UTF8.decoder).join(); 50 return await response.transform(UTF8.decoder).join();
51 } 51 }
52 52
53 ArgParser createArgParser() { 53 ArgParser createArgParser() {
54 ArgParser argParser = new ArgParser(); 54 ArgParser argParser = new ArgParser();
55 argParser.addFlag('help', help: "Help");
55 argParser.addFlag('verbose', 56 argParser.addFlag('verbose',
56 abbr: 'v', negatable: false, help: "Turn on logging output."); 57 abbr: 'v', negatable: false, help: "Turn on logging output.");
57 argParser.addOption('cache', 58 argParser.addOption('cache',
58 help: "Use <dir> for caching test output.\n" 59 help: "Use <dir> for caching test output.\n"
59 "Defaults to 'temp/gardening-cache/'."); 60 "Defaults to 'temp/gardening-cache/'.");
60 return argParser; 61 return argParser;
61 } 62 }
62 63
63 void processArgResults(ArgResults argResults) { 64 void processArgResults(ArgResults argResults) {
64 if (argResults['verbose']) { 65 if (argResults['verbose']) {
65 LOG = true; 66 LOG = true;
66 } 67 }
67 if (argResults['cache'] != null) { 68 if (argResults['cache'] != null) {
68 cache.base = Uri.base.resolve('${argResults['cache']}/'); 69 cache.base = Uri.base.resolve('${argResults['cache']}/');
69 } 70 }
70 } 71 }
OLDNEW
« no previous file with comments | « tools/gardening/bin/status_summary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698