From 940be3bb32ed1f11c46ede98d51516998b17e128 Mon Sep 17 00:00:00 2001 From: slotThe Date: Sat, 4 Jan 2020 21:20:56 +0100 Subject: Replace parseOpts with a generic function --- src/Xmobar/Plugins/Monitors/Cpu.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/Xmobar/Plugins/Monitors/Cpu.hs') diff --git a/src/Xmobar/Plugins/Monitors/Cpu.hs b/src/Xmobar/Plugins/Monitors/Cpu.hs index 6befe7d..157631d 100644 --- a/src/Xmobar/Plugins/Monitors/Cpu.hs +++ b/src/Xmobar/Plugins/Monitors/Cpu.hs @@ -35,12 +35,6 @@ options = o { loadIconPattern = Just $ parseIconPattern x }) "") "" ] -parseOpts :: [String] -> IO CpuOpts -parseOpts argv = - case getOpt Permute options argv of - (o, _, []) -> return $ foldr id defaultOpts o - (_, _, errs) -> ioError . userError $ concat errs - cpuConfig :: IO MConfig cpuConfig = mkMConfig "Cpu: %" @@ -77,7 +71,7 @@ formatCpu opts xs = do runCpu :: CpuDataRef -> [String] -> Monitor String runCpu cref argv = do c <- io (parseCpu cref) - opts <- io $ parseOpts argv + opts <- io $ parseOptsWith options defaultOpts argv l <- formatCpu opts c parseTemplate l -- cgit v1.2.3