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

Unified Diff: git_cl.py

Issue 1799203002: git cl try-results: make color force-able. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 87b5acfb96915779d9f5160f33b411217354b523..a86ac021903c3774a829f35f4f3dffbe8317b60f 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -453,7 +453,7 @@ def print_tryjobs(options, builds):
def pop(title, f, color=None, **kwargs):
"""Pop matching builds from `builds` dict and print them."""
- if not sys.stdout.isatty() or color is None:
+ if not options.color or color is None:
colorize = str
else:
colorize = lambda x: '%s%s%s' % (color, x, Fore.RESET)
@@ -3552,7 +3552,10 @@ def CMDtry_results(parser, args):
group.add_option(
"-p", "--patchset", type=int, help="patchset number if not current.")
group.add_option(
- "--print-master", action='store_true', help="print master name as well")
+ "--print-master", action='store_true', help="print master name as well.")
+ group.add_option(
+ "--color", action='store_true', default=sys.stdout.isatty(),
+ help="force color output, useful when piping output.")
group.add_option(
"--buildbucket-host", default='cr-buildbucket.appspot.com',
help="Host of buildbucket. The default host is %default.")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698