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/MBox.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/Xmobar/Plugins/MBox.hs') diff --git a/src/Xmobar/Plugins/MBox.hs b/src/Xmobar/Plugins/MBox.hs index 311f26e..dc30972 100644 --- a/src/Xmobar/Plugins/MBox.hs +++ b/src/Xmobar/Plugins/MBox.hs @@ -19,6 +19,7 @@ import Prelude import Xmobar.Run.Exec #ifdef INOTIFY +import Xmobar.Plugins.Monitors.Common (parseOptsWith) import Xmobar.System.Utils (changeLoop, expandHome) import Control.Monad (when) @@ -63,12 +64,6 @@ options = , Option "s" ["suffix"] (ReqArg (\x o -> o { oSuffix = x }) "") "" ] -parseOptions :: [String] -> IO Options -parseOptions args = - case getOpt Permute options args of - (o, _, []) -> return $ foldr id defaults o - (_, _, errs) -> ioError . userError $ concat errs - #else import System.IO #endif @@ -86,7 +81,7 @@ instance Exec MBox where " but the MBox plugin requires it" #else start (MBox boxes args _) cb = do - opts <- parseOptions args + opts <- parseOptsWith options defaults args let showAll = oAll opts prefix = oPrefix opts suffix = oSuffix opts -- cgit v1.2.3