Handle empty list error

This commit is contained in:
rnhmjoj 2015-07-07 23:46:58 +02:00
parent 09a4246135
commit 25f6624e68

View File

@ -90,7 +90,10 @@ search ProgArgs {..} = do
let res = if null exactMatches
then select (fuzzy searchTerm items)
else select (byAttrib (Left exactMatches, Str searchTerm) items)
if contentOnly
then mapM_ putStrLn (map content res)
else pprint res
when (not noClipboard) (sendClipboard (content $ head res))
if null res
then putStrLn "No results found"
else do
if contentOnly
then mapM_ putStrLn (map content res)
else pprint res
when (not noClipboard) (sendClipboard (content $ head res))