catf
… is a syntax-aware version of cat
.
Install Pygments:
⚡ pip install Pygments
Place catf
in a location included in your path and make sure it's executable, ex:
⚡ curl "https://raw.githubusercontent.com/davidfmiller/catf/master/catf > ~/bin/catf ⚡ chmod 700 ~/bin/catf
catf
reads from stdio
or filenames passed as arguments, ex:
⚡ curl "http://readmeansrun.com/code/readmeansafari/test/json.php" | catf { "array" : [ ], "bool" : true , "link" : "http://readmeansrun.com", "object" : { "string" : "Hello world", "number" : 42 } } ⚡ catf ~/Documents/git/apples/note #!/usr/bin/python # -*- coding: utf-8 -*- """ Create a new note from the command-line """ import sys import os import getopt import tempfile import subprocess def esc(arg): """ Escapes a string's characters @param arg (string) @return string """ buf = '' for i in arg: if (i == '\\'): buf += '\\\\' elif (i == '\n'): buf += '<br/>' elif (i == '"'): buf += '\\"' elif (i == ' '): buf += ' ' elif (i == '>'): buf += '>' elif (i == '<'): buf += '<' else: buf += i return buf ...#
-d
stderr
) which lexer is being used-v
-h
-u
-l {arg}
{arg}
can be one of:
v0.0.1
- ???