summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--pygments/cmdline.py8
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 03d38198..845105ba 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,8 @@ Version 1.6
* Dylan console (PR#149)
* Logos (PR#150)
+- Fix guessed lexers not receiving lexer options (#838).
+
Version 1.6rc1
--------------
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 3bf081d4..c25204bf 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -378,9 +378,9 @@ def main(args=sys.argv):
except ClassNotFound, err:
if '-g' in opts:
try:
- lexer = guess_lexer(code)
+ lexer = guess_lexer(code, **parsed_opts)
except ClassNotFound:
- lexer = TextLexer()
+ lexer = TextLexer(**parsed_opts)
else:
print >>sys.stderr, 'Error:', err
return 1
@@ -392,9 +392,9 @@ def main(args=sys.argv):
if '-g' in opts:
code = sys.stdin.read()
try:
- lexer = guess_lexer(code)
+ lexer = guess_lexer(code, **parsed_opts)
except ClassNotFound:
- lexer = TextLexer()
+ lexer = TextLexer(**parsed_opts)
elif not lexer:
print >>sys.stderr, 'Error: no lexer name given and reading ' + \
'from stdin (try using -g or -l <lexer>)'