1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #372 resolved

Command line argument to determine lexer based on filename only

Anonymous created an issue

I'd like pygments to attempt to determine a lexer based only on the filename via the command line. This is useful when the filename is known as well as the contents but the file does not actually exist on disk anywhere.

{{{ [masseria]$ ./pygmentize -N test.py python [masseria]$ ./pygmentize -N test.java java [masseria]$ ./pygmentize -N test.sh bash [masseria]$ ./pygmentize -N test.klajdfklj text }}}

I've included a patch to add this functionality.

Reported by JakeWharton

Comments (2)

  1. Log in to comment