ENH use bracket dbus for xmobar tests
This commit is contained in:
parent
3b8c6b0f4f
commit
8c20a4668d
|
@ -46,7 +46,7 @@ main = getArgs >>= parse
|
|||
parse :: [String] -> IO ()
|
||||
parse [] = run
|
||||
parse ["--deps"] = withCache printDeps
|
||||
parse ["--test"] = void $ withCache . evalConfig =<< connectDBus
|
||||
parse ["--test"] = withCache $ withDBus_ evalConfig
|
||||
parse _ = usage
|
||||
|
||||
run :: IO ()
|
||||
|
@ -66,11 +66,13 @@ evalConfig db = do
|
|||
return $ config bf ifs ios cs d
|
||||
|
||||
printDeps :: FIO ()
|
||||
printDeps = do
|
||||
db <- io connectDBus
|
||||
let ps = sort $ nub $ fmap showFulfillment $ concatMap dumpFeature $ allFeatures db
|
||||
io $ mapM_ (putStrLn . T.unpack) ps
|
||||
io $ disconnectDBus db
|
||||
printDeps = withDBus_ $ \db ->
|
||||
mapM_ (liftIO . putStrLn . T.unpack) $
|
||||
sort $
|
||||
nub $
|
||||
fmap showFulfillment $
|
||||
concatMap dumpFeature $
|
||||
allFeatures db
|
||||
|
||||
usage :: IO ()
|
||||
usage =
|
||||
|
|
Loading…
Reference in New Issue