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/Wireless.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/Xmobar/Plugins/Monitors/Wireless.hs') diff --git a/src/Xmobar/Plugins/Monitors/Wireless.hs b/src/Xmobar/Plugins/Monitors/Wireless.hs index 545f6bc..f2b1e6a 100644 --- a/src/Xmobar/Plugins/Monitors/Wireless.hs +++ b/src/Xmobar/Plugins/Monitors/Wireless.hs @@ -34,12 +34,6 @@ options = opts { qualityIconPattern = Just $ parseIconPattern d }) "") "" ] -parseOpts :: [String] -> IO WirelessOpts -parseOpts argv = - case getOpt Permute options argv of - (o, _, []) -> return $ foldr id defaultOpts o - (_, _, errs) -> ioError . userError $ concat errs - wirelessConfig :: IO MConfig wirelessConfig = mkMConfig " " @@ -47,7 +41,7 @@ wirelessConfig = runWireless :: String -> [String] -> Monitor String runWireless iface args = do - opts <- io $ parseOpts args + opts <- io $ parseOptsWith options defaultOpts args iface' <- if "" == iface then io findInterface else return iface wi <- io $ getWirelessInfo iface' na <- getConfigValue naString -- cgit v1.2.3