summaryrefslogtreecommitdiff
path: root/Command/Watch.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Watch.hs')
-rw-r--r--Command/Watch.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs
index a33fc633c..bcfdf14bf 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -17,10 +17,11 @@ def :: [Command]
def = [notBareRepo $ withOptions [foregroundOption, stopOption] $
command "watch" paramNothing seek SectionCommon "watch for changes"]
-seek :: [CommandSeek]
-seek = [withFlag stopOption $ \stopdaemon ->
- withFlag foregroundOption $ \foreground ->
- withNothing $ start False foreground stopdaemon Nothing]
+seek :: CommandSeek
+seek ps = do
+ stopdaemon <- getOptionFlag stopOption
+ foreground <- getOptionFlag foregroundOption
+ withNothing (start False foreground stopdaemon Nothing) ps
foregroundOption :: Option
foregroundOption = Option.flag [] "foreground" "do not daemonize"