Commits

Eli Bendersky  committed 65bb3c2 Merge

Merged in pekkaklarck/pss (pull request #2)

  • Participants
  • Parent commits 93399e3, 2b277b4

Comments (0)

Files changed (1)

File psslib/pss.py

         action='store', dest='context', metavar='NUM', type='int',
         help='Print NUM lines of context before and after each match')
     group_output.add_option('--color',
-        action='store_true', dest='do_colors', default=True,
-        help='Highlight the matching text')
+        action='store_true', dest='do_colors', default=sys.stdout.isatty(),
+        help='Highlight the matching text (on unless output is redirected')
     group_output.add_option('--nocolor',
         action='store_false', dest='do_colors',
         help='Do not highlight the matching text')