Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 42a5eabc18207e364575959ab1d420de7f6f9f12..7fdc6aa7fe73dfe5e41477ec7a9c5233f5c153b0 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -4757,6 +4757,9 @@ def CMDtry_results(parser, args): |
group.add_option( |
"--buildbucket-host", default='cr-buildbucket.appspot.com', |
help="Host of buildbucket. The default host is %default.") |
+ group.add_option( |
+ "--json", action='store_true', default=False, |
tandrii(chromium)
2016/08/24 11:32:23
no need for default.
qyearsley
2016/08/26 01:56:47
Now changing this to be an option that takes a fil
|
+ help="Output try job results as JSON instead of a human-readable format.") |
tandrii(chromium)
2016/08/24 11:32:23
IMO, change to 'write try job results as JSON to a
qyearsley
2016/08/26 01:56:47
Sounds good.
|
parser.add_option_group(group) |
auth.add_auth_options(parser) |
options, args = parser.parse_args(args) |
@@ -4785,7 +4788,10 @@ def CMDtry_results(parser, args): |
print('ERROR: Exception when trying to fetch tryjobs: %s\n%s' % |
(e, stacktrace)) |
return 1 |
- print_tryjobs(options, jobs) |
+ if options.json: |
+ print(json.dumps(jobs, indent=2)) |
tandrii(chromium)
2016/08/24 11:32:23
hm, you want to dump the *whole* metadata? i don't
|
+ else: |
+ print_tryjobs(options, jobs) |
return 0 |