Additional flag -x is undocumented, and it does not work ?

Issue #1370 new
Anonymous created an issue

"man pygmentize" and "pygmentize --help" does not show -x option, but it is existing according to this page:

"Then you can load the lexer from the command line with the additional flag -x:

$ pygmentize -l your_lexer_file.py -x"(http://pygments.org/docs/lexerdevelopment/)

It seems that -x flag does not even work with Pygments version 2.1, because this will show only usage message:

echo Exception |pygmentize -l ./exception_lexer.py:ExceptionLexer -x

I am trying to get some color to "Exception" words, (which are located in log4j error log), so I write this lexer:

$ cat exception_lexer.py from pygments.lexer import RegexLexer from pygments.token import *

class ExceptionLexer(RegexLexer): name = 'Exception' tokens = { 'root': [ (r'Exception.*\n', Generic.Deleted), ]

Comments (0)

  1. Log in to comment