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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gardening/bin/compare_failures.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gardening/bin/bot.dart
diff --git a/tools/gardening/bin/bot.dart b/tools/gardening/bin/bot.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d775bba15e63668862f36d129d718f9471fd8a08
--- /dev/null
+++ b/tools/gardening/bin/bot.dart
@@ -0,0 +1,40 @@
+import 'dart:io';
+
+import 'compare_failures.dart' as compare_failures;
+import 'current_summary.dart' as current_summary;
+import 'status_summary.dart' as status_summary;
+
+void help(List<String> args) {
+ if (args.length == 1 && args[0] == "--help") {
+ print("This help");
+ return;
+ }
+
+ print("A script that combines multiple commands:\n");
+
+ commands.forEach((command, fun) {
+ print("$command:");
+ fun(["--help"]);
+ print("");
+ });
+}
+
+const commands = const {
+ "help": help,
+ "compare-failures": compare_failures.main,
+ "current-summary": current_summary.main,
+ "status-summary": status_summary.main,
+};
+
+void main(List<String> args) {
+ if (args.isEmpty) {
+ help([]);
+ exit(-1);
+ }
+ var command = commands[args[0]];
+ if (command == null) {
+ help([]);
+ exit(-1);
+ }
+ command(args.sublist(1));
+}
« 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