diff options
author | slotThe <soliditsallgood@tuta.io> | 2020-01-04 21:20:56 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-01-04 21:21:40 +0000 |
commit | 940be3bb32ed1f11c46ede98d51516998b17e128 (patch) | |
tree | 6d0c942c10efc64514dd419f746f631aec19c935 /src/Xmobar/Plugins/MBox.hs | |
parent | 2ec513d2e193998958ad5bf4a5f7280f595792e9 (diff) | |
download | xmobar-940be3bb32ed1f11c46ede98d51516998b17e128.tar.gz xmobar-940be3bb32ed1f11c46ede98d51516998b17e128.tar.bz2 |
Replace parseOpts with a generic function
Diffstat (limited to 'src/Xmobar/Plugins/MBox.hs')
-rw-r--r-- | src/Xmobar/Plugins/MBox.hs | 9 |
1 files changed, 2 insertions, 7 deletions
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 |