From 14267de1e03841980ce99206c0cf63e40bfa6cca Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Wed, 11 Jul 2007 20:31:31 +0200 Subject: Commands.hs: monitors take only one action now darcs-hash:20070711183131-d6583-785f3e62b8ef00537fa85ee94682d305cdfd008d.gz --- Commands.hs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'Commands.hs') diff --git a/Commands.hs b/Commands.hs index 8d39d30..7c0985e 100644 --- a/Commands.hs +++ b/Commands.hs @@ -54,18 +54,12 @@ class Exec e where run :: e -> IO String instance Exec Command where - run (Weather s a) = do let af = return "No station ID specified" - runM (a ++ [s]) weatherConfig af runWeather - run (Network i a) = do let f = return "No device specified" - runM (a ++ [i]) netConfig f runNet - run (Memory args) = do let af = runMem [] - runM args memConfig af runMem - run (Swap args) = do let af = runSwap [] - runM args swapConfig af runSwap - run (Cpu args) = do let af = runCpu [] - runM args cpuConfig af runCpu - run (Battery args) = do let af = runBatt [] - runM args battConfig af runBatt + run (Weather s a) = runM (a ++ [s]) weatherConfig runWeather + run (Network i a) = runM (a ++ [i]) netConfig runNet + run (Memory args) = runM args memConfig runMem + run (Swap args) = runM args swapConfig runSwap + run (Cpu args) = runM args cpuConfig runCpu + run (Battery args) = runM args battConfig runBatt run (Exec prog args _) = do (i,o,e,p) <- runInteractiveCommand (prog ++ concat (map (' ':) args)) exit <- waitForProcess p let closeHandles = do hClose o -- cgit v1.2.3