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

Side by Side Diff: tools/gardening/bin/bot.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 | « no previous file | tools/gardening/bin/compare_failures.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import 'dart:io';
2
3 import 'compare_failures.dart' as compare_failures;
4 import 'current_summary.dart' as current_summary;
5 import 'status_summary.dart' as status_summary;
6
7 void help(List<String> args) {
8 if (args.length == 1 && args[0] == "--help") {
9 print("This help");
10 return;
11 }
12
13 print("A script that combines multiple commands:\n");
14
15 commands.forEach((command, fun) {
16 print("$command:");
17 fun(["--help"]);
18 print("");
19 });
20 }
21
22 const commands = const {
23 "help": help,
24 "compare-failures": compare_failures.main,
25 "current-summary": current_summary.main,
26 "status-summary": status_summary.main,
27 };
28
29 void main(List<String> args) {
30 if (args.isEmpty) {
31 help([]);
32 exit(-1);
33 }
34 var command = commands[args[0]];
35 if (command == null) {
36 help([]);
37 exit(-1);
38 }
39 command(args.sublist(1));
40 }
OLDNEW
« no previous file with comments | « no previous file | tools/gardening/bin/compare_failures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698