1{-# LANGUAGE BangPatterns #-}
3import System.Environment (getArgs)
4import qualified Data.Text.Lazy.IO as T
5import qualified Data.Text.Lazy as T
6import qualified Data.Text.Lazy.Encoding as T
7import qualified Data.ByteString.Lazy.Char8 as B
8import qualified Data.ByteString.Char8 as BS
9import qualified Data.ByteString.Lazy.Search as B
11text :: FilePath -> String -> IO ()
12text file pat = T.readFile file >>= print . T.count (T.pack pat)
14textBS :: FilePath -> String -> IO ()
15textBS file pat = B.readFile file >>= print . T.count (T.pack pat) . T.decodeUtf8
17bytestring :: FilePath -> String -> IO ()
18bytestring file pat = B.readFile file >>= print . length . B.indices (BS.pack pat)
21 (name : file : pat : _) <- getArgs
23 "bs" -> bytestring file pat
24 "text" -> text file pat
25 "textBS" -> textBS file pat
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list