summaryrefslogtreecommitdiff
path: root/pygments/cmdline.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-11 19:28:12 +0100
committerGeorg Brandl <georg@python.org>2014-11-11 19:28:12 +0100
commitc37f936452070c9d6f478ce91990f5cc241c86f5 (patch)
treed86f66a6a68f8e9670e3e8a3ca16840091c0e196 /pygments/cmdline.py
parent7ea9ac3db778e05fe2655018ca2fc5736c837489 (diff)
downloadpygments-c37f936452070c9d6f478ce91990f5cc241c86f5.tar.gz
cmdline: more coverage
Diffstat (limited to 'pygments/cmdline.py')
-rw-r--r--pygments/cmdline.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 608bd859..9d6742a3 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -301,12 +301,7 @@ def main_inner(popts, args, usage):
print(err, file=sys.stderr)
return 1
- arg = a_opt or ''
- try:
- print(fmter.get_style_defs(arg))
- except Exception as err:
- print('Error:', err, file=sys.stderr)
- return 1
+ print(fmter.get_style_defs(a_opt or ''))
return 0
# if no -S is given, -a is not allowed
@@ -341,7 +336,7 @@ def main_inner(popts, args, usage):
if '-s' in opts:
print('Error: -s option not usable when input file specified',
file=sys.stderr)
- return 1
+ return 2
infn = args[0]
try: