diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-18 17:24:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-18 17:24:18 -0400 |
commit | 72bd1369cd32320bb268b16b97032b1f11b33edc (patch) | |
tree | a3755b42a8a78da084d55d6292b15417f3debbb0 /Command | |
parent | 8fd72896652925d9d85b4e2ff27b31a2a2af92af (diff) |
dropunused, addunused: Allow "all" instead of a range to act on all unused data.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Unused.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs index 844cdb19b..1e5cdc163 100644 --- a/Command/Unused.hs +++ b/Command/Unused.hs @@ -332,11 +332,13 @@ withUnusedMaps a params = do unused <- readUnusedLog "" unusedbad <- readUnusedLog "bad" unusedtmp <- readUnusedLog "tmp" + let m = unused `M.union` unusedbad `M.union` unusedtmp return $ map (a $ UnusedMaps unused unusedbad unusedtmp) $ - concatMap unusedSpec params + concatMap (unusedSpec m) params -unusedSpec :: String -> [Int] -unusedSpec spec +unusedSpec :: UnusedMap -> String -> [Int] +unusedSpec m spec + | spec == "all" = [fst (M.findMin m)..fst (M.findMax m)] | "-" `isInfixOf` spec = range $ separate (== '-') spec | otherwise = maybe badspec (: []) (readish spec) where |