1{-# LANGUAGE BangPatterns, OverloadedStrings #-}
3import Control.Exception
6import Data.Attoparsec.ByteString (IResult(..), parseWith)
8import System.Environment (getArgs)
10import qualified Data.ByteString as B
14 (bs:cnt:args) <- getArgs
15 let count = read cnt :: Int
17 forM_ args $ \arg -> bracket (openFile arg ReadMode) hClose $ \h -> do
19 start <- getCurrentTime
21 | good+bad >= count = return (good, bad)
23 hSeek h AbsoluteSeek 0
24 let refill = B.hGet h blkSize
25 result <- parseWith refill json =<< refill
27 Done _ _ -> loop (good+1) bad
28 _ -> loop good (bad+1)
30 delta <- flip diffUTCTime start `fmap` getCurrentTime
31 putStrLn $ " " ++ show good ++ " good, " ++ show delta
32 let rate = fromIntegral count / realToFrac delta :: Double
33 putStrLn $ " " ++ show (round rate :: Int) ++ " per second"
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