Hansa::CLI
Constants
DOC = "Hansa, detect the programming language of files by content only.\n\nUsage:\n hansa [options] <file>...\n hansa -h | --help\n hansa -V | --version\n\nOptions:\n -h, --help Show this help.\n -V, --version Show version.\n\nA <file> of \"-\" reads standard input."
MAX_READ_BYTES = 256 * 1024
The classifier only ever looks at the first 50K characters, so reading more than this from disk is wasted work. 256KB covers 50K four-byte UTF-8 characters with room to spare; a read that cuts a multibyte character in half is cleaned up by the scrub in Hansa.classify.