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

Side by Side Diff: tools/gardening/bin/bot.dart

Issue 2915043002: Added find-shard to bot.dart. (Closed)
Patch Set: 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 | « no previous file | tools/gardening/bin/find_shard.dart » ('j') | 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:io'; 6 import 'dart:io';
7 7
8 import 'compare_failures.dart' as compare_failures; 8 import 'compare_failures.dart' as compare_failures;
9 import 'current_summary.dart' as current_summary; 9 import 'current_summary.dart' as current_summary;
10 import 'status_summary.dart' as status_summary; 10 import 'status_summary.dart' as status_summary;
11 import 'find_shard.dart' as find_shard;
11 12
12 typedef Future MainFunction(List<String> args); 13 typedef Future MainFunction(List<String> args);
13 14
14 help(List<String> args) async { 15 help(List<String> args) async {
15 if (args.length == 1 && args[0] == "--help") { 16 if (args.length == 1 && args[0] == "--help") {
16 print("This help"); 17 print("This help");
17 return null; 18 return null;
18 } 19 }
19 20
20 print("A script that combines multiple commands:\n"); 21 print("A script that combines multiple commands:\n");
21 22
22 for (String command in commands.keys) { 23 for (String command in commands.keys) {
23 print(command); 24 print(command);
24 print('-' * command.length); 25 print('-' * command.length);
25 await commands[command](["--help"]); 26 await commands[command](["--help"]);
26 print(""); 27 print("");
27 } 28 }
28 } 29 }
29 30
30 const Map<String, MainFunction> commands = const <String, MainFunction>{ 31 const Map<String, MainFunction> commands = const <String, MainFunction>{
31 "help": help, 32 "help": help,
32 "compare-failures": compare_failures.main, 33 "compare-failures": compare_failures.main,
33 "current-summary": current_summary.main, 34 "current-summary": current_summary.main,
34 "status-summary": status_summary.main, 35 "status-summary": status_summary.main,
36 "find-shard": find_shard.main,
35 }; 37 };
36 38
37 main(List<String> args) async { 39 main(List<String> args) async {
38 if (args.isEmpty) { 40 if (args.isEmpty) {
39 await help([]); 41 await help([]);
40 exit(-1); 42 exit(-1);
41 } 43 }
42 var command = commands[args[0]]; 44 var command = commands[args[0]];
43 if (command == null) { 45 if (command == null) {
44 await help([]); 46 await help([]);
45 exit(-1); 47 exit(-1);
46 } 48 }
47 command(args.sublist(1)); 49 command(args.sublist(1));
48 } 50 }
OLDNEW
« no previous file with comments | « no previous file | tools/gardening/bin/find_shard.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698