diff options
author | Sibi Prabakaran <sibi@psibi.in> | 2020-06-14 15:42:47 +0530 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-06-23 16:38:20 +0100 |
commit | 34c5473dcff2e583591e2713400947aaa59f752f (patch) | |
tree | 8219f9399f715da708e31164363104daeebe9fd1 /src/Xmobar/Plugins/Monitors/Common/Run.hs | |
parent | 8aec308ae2030f8bff7bc58ec435b8a610951d0a (diff) | |
download | xmobar-34c5473dcff2e583591e2713400947aaa59f752f.tar.gz xmobar-34c5473dcff2e583591e2713400947aaa59f752f.tar.bz2 |
More cleanup
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Common/Run.hs')
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Common/Run.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Run.hs b/src/Xmobar/Plugins/Monitors/Common/Run.hs index 9b0c1b7..076ac07 100644 --- a/src/Xmobar/Plugins/Monitors/Common/Run.hs +++ b/src/Xmobar/Plugins/Monitors/Common/Run.hs @@ -24,7 +24,7 @@ module Xmobar.Plugins.Monitors.Common.Run ( runM , getArgvs , doArgs , computePureConfig - , commonOptions + , pluginOptions ) where import Control.Exception (SomeException,handle) @@ -35,10 +35,8 @@ import System.Console.GetOpt import Xmobar.Plugins.Monitors.Common.Types import Xmobar.Run.Exec (doEveryTenthSeconds) -commonOptions = options - -options :: [OptDescr Opts] -options = +pluginOptions :: [OptDescr Opts] +pluginOptions = [ Option ['H'] ["High"] (ReqArg High "number") "The high threshold" , Option ['L'] ["Low"] (ReqArg Low "number") "The low threshold" @@ -66,7 +64,7 @@ options = -- | Get all argument values out of a list of arguments. getArgvs :: [String] -> [String] getArgvs args = - case getOpt Permute options args of + case getOpt Permute pluginOptions args of (_, n, [] ) -> n (_, _, errs) -> errs @@ -77,7 +75,7 @@ doArgs :: [String] -> ([String] -> Monitor Bool) -> Monitor String doArgs args action detect = - case getOpt Permute options args of + case getOpt Permute pluginOptions args of (o, n, []) -> do doConfigOptions o ready <- detect n if ready @@ -158,6 +156,6 @@ getMConfig args mconfig = do runReaderT (updateOptions args >> ask) config updateOptions :: [String] -> Monitor () -updateOptions args= case getOpt Permute options args of +updateOptions args= case getOpt Permute pluginOptions args of (o, _, []) -> doConfigOptions o _ -> return () |