Commits

Georg Brandl committed 027a3b0

Closes #838: fix lexers not receiving command-line options when guessing by content.

  • Participants
  • Parent commits 8731624

Comments (0)

Files changed (2)

   * Dylan console (PR#149)
   * Logos (PR#150)
 
+- Fix guessed lexers not receiving lexer options (#838).
+
 
 Version 1.6rc1
 --------------

File pygments/cmdline.py

             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
         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>)'