Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Action/Search.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ actionSearch Search{..} = replicateM_ repeat_ $ -- deliberately reopen the datab
Nothing -> hSupportsANSI stdout
let (shown, hidden) = splitAt count' $ nubOrd $ map (targetResultDisplay link color' q) res
if null res then
putStrLn "No results found"
if | json -> putStrLn "[]"
| jsonl -> putStrLn ""
| otherwise -> putStrLn "No results found"
else if info then do
mapM_ (putStr . targetInfo color' q)
$ (case count of
Expand All @@ -64,7 +66,7 @@ actionSearch Search{..} = replicateM_ repeat_ $ -- deliberately reopen the datab
if | json -> LBS.putStrLn $ JSON.encode $ maybe id take count $ map unHTMLtargetItem res
| jsonl -> mapM_ (LBS.putStrLn . JSON.encode) $ maybe id take count $ map unHTMLtargetItem res
| otherwise -> putStr $ unlines $ if numbers then addCounter shown else shown
when (hidden /= [] && not json) $ do
when (hidden /= [] && not json && not jsonl) $ do
whenNormal $ putStrLn $ "-- plus more results not shown, pass --count=" ++ show (count'+10) ++ " to see more"
else do
let parseType x = case parseQuery x of
Expand Down