summaryrefslogtreecommitdiff
path: root/pygments/cmdline.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-01-09 13:15:36 +0100
committerGeorg Brandl <georg@python.org>2013-01-09 13:15:36 +0100
commit1b551e169d6c29d49c90baa62ea8886a7e8be46f (patch)
tree4c57f637cf7d23a1a52f058b1dba36d32d1ed73d /pygments/cmdline.py
parent01ff62d16bcb567d2c7becd241e2b5bfb1bd3a93 (diff)
parent73a4b067b9ec07088e7c2e77e3f3c040aedcd50c (diff)
downloadpygments-1b551e169d6c29d49c90baa62ea8886a7e8be46f.tar.gz
Merged in alastairh/pygments (pull request #141: Improve and unify C family language lexers)
Diffstat (limited to 'pygments/cmdline.py')
-rw-r--r--pygments/cmdline.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 1f14cf5d..3bf081d4 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -5,7 +5,7 @@
Command line interface.
- :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
@@ -192,6 +192,14 @@ def main(args=sys.argv):
usage = USAGE % ((args[0],) * 6)
+ if sys.platform in ['win32', 'cygwin']:
+ try:
+ # Provide coloring under Windows, if possible
+ import colorama
+ colorama.init()
+ except ImportError:
+ pass
+
try:
popts, args = getopt.getopt(args[1:], "l:f:F:o:O:P:LS:a:N:hVHg")
except getopt.GetoptError, err:
@@ -219,7 +227,7 @@ def main(args=sys.argv):
return 0
if opts.pop('-V', None) is not None:
- print 'Pygments version %s, (c) 2006-2012 by Georg Brandl.' % __version__
+ print 'Pygments version %s, (c) 2006-2013 by Georg Brandl.' % __version__
return 0
# handle ``pygmentize -L``