Skip to content

Commit 84ccc3c

Browse files
Reorder imports and add --always-colors flag
1 parent 85da784 commit 84ccc3c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bin/git-bc-show-eligible

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
from __future__ import unicode_literals
55

6-
import subprocess
76
import argparse
87
import datetime
98
import pygit2
10-
import sys
119
import re
10+
import subprocess
11+
import sys
1212

1313
def find_toplevel():
1414
try:
@@ -62,6 +62,7 @@ def main():
6262
parser.add_argument('--show-dates', action='store_true', help='Show dates in %Y-%m-%d %H:%M:%S')
6363

6464
parser.add_argument('--all', action='store_true', help='Show commits from all users')
65+
parser.add_argument('--always-colors', action='store_true', help='Always force colored output')
6566

6667
top = find_toplevel()
6768

@@ -99,7 +100,7 @@ def main():
99100
author_format_str = ' | %s <%s>'
100101
commit_format_str = '%s %s%s'
101102

102-
if sys.stdout.isatty():
103+
if sys.stdout.isatty() or args.always_colors:
103104
author_format_str = ' \033[31m| %s <%s>\033[0m'
104105
commit_format_str = '\033[33m%s\033[0m %s%s'
105106

0 commit comments

Comments
 (0)