File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ search_ = Search
134134 ,jsonl = def &= name " jsonl" &= help " Get result as JSONL (JSON Lines)"
135135 ,link = def &= help " Give URL's for each result"
136136 ,numbers = def &= help " Give counter for each result"
137- ,info = def &= help " Give extended information about the first result "
137+ ,info = def &= help " Give extended information about the first n results (set n with --count, default is 1) "
138138 ,database = def &= typFile &= help " Name of database to use (use .hoo extension)"
139139 ,count = Nothing &= name " n" &= help " Maximum number of results to return (defaults to 10)"
140140 ,query = def &= args &= typ " QUERY"
Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ actionSearch Search{..} = replicateM_ repeat_ $ -- deliberately reopen the datab
5353 if null res then
5454 putStrLn " No results found"
5555 else if info then do
56- putStr $ targetInfo $ headErr res
56+ mapM_ (putStr . targetInfo)
57+ $ (case count of
58+ Just c -> take c
59+ Nothing -> singleton . headErr) res
5760 else do
5861 let toShow = if numbers && not info then addCounter shown else shown
5962 if | json -> LBS. putStrLn $ JSON. encode $ maybe id take count $ map unHTMLtargetItem res
You can’t perform that action at this time.
0 commit comments