summaryrefslogtreecommitdiff
path: root/pygments/cmdline.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-09-07 19:55:25 +0200
committergbrandl <devnull@localhost>2008-09-07 19:55:25 +0200
commit929a6088c819ccd5a1cf6f8694c3246ef5d0b2fc (patch)
treeb9281ce466546439fe42b10d5196c2c7361ab1ea /pygments/cmdline.py
parent4ba95409a3b64075c99d4f7f3c405857578a2670 (diff)
downloadpygments-929a6088c819ccd5a1cf6f8694c3246ef5d0b2fc.tar.gz
Raise exception when trying to use -S with the image formatter.
Diffstat (limited to 'pygments/cmdline.py')
-rw-r--r--pygments/cmdline.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index de10debe..4d485b6e 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -281,7 +281,11 @@ def main(args=sys.argv):
return 1
arg = a_opt or ''
- print fmter.get_style_defs(arg)
+ try:
+ print fmter.get_style_defs(arg)
+ except Exception, err:
+ print >>sys.stderr, 'Error:', err
+ return 1
return 0
# if no -S is given, -a is not allowed