Handle empty list error
This commit is contained in:
parent
09a4246135
commit
25f6624e68
11
src/Main.hs
11
src/Main.hs
@ -90,7 +90,10 @@ search ProgArgs {..} = do
|
|||||||
let res = if null exactMatches
|
let res = if null exactMatches
|
||||||
then select (fuzzy searchTerm items)
|
then select (fuzzy searchTerm items)
|
||||||
else select (byAttrib (Left exactMatches, Str searchTerm) items)
|
else select (byAttrib (Left exactMatches, Str searchTerm) items)
|
||||||
if contentOnly
|
if null res
|
||||||
then mapM_ putStrLn (map content res)
|
then putStrLn "No results found"
|
||||||
else pprint res
|
else do
|
||||||
when (not noClipboard) (sendClipboard (content $ head res))
|
if contentOnly
|
||||||
|
then mapM_ putStrLn (map content res)
|
||||||
|
else pprint res
|
||||||
|
when (not noClipboard) (sendClipboard (content $ head res))
|
||||||
|
Loading…
Reference in New Issue
Block a user