summaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-13 11:42:42 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-13 11:42:42 -0400
commit2228571a90fbe00b02ee1f22fab92c9e824093df (patch)
tree8de8ad7e28e5f8f393f42ae078b9c4ed5f448d13 /CmdLine
parent93d62419262ca6ec924babe734780f7753d887a4 (diff)
converted Assistant and Watch; avoid duplicate arg parsing for no repo mode
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitAnnex.hs8
-rw-r--r--CmdLine/GitAnnex/Options.hs16
2 files changed, 20 insertions, 4 deletions
diff --git a/CmdLine/GitAnnex.hs b/CmdLine/GitAnnex.hs
index ede943804..28a741b79 100644
--- a/CmdLine/GitAnnex.hs
+++ b/CmdLine/GitAnnex.hs
@@ -98,8 +98,8 @@ import qualified Command.DiffDriver
import qualified Command.Undo
import qualified Command.Version
#ifdef WITH_ASSISTANT
---import qualified Command.Watch
---import qualified Command.Assistant
+import qualified Command.Watch
+import qualified Command.Assistant
#ifdef WITH_WEBAPP
--import qualified Command.WebApp
#endif
@@ -203,8 +203,8 @@ cmds =
, Command.Undo.cmd
, Command.Version.cmd
#ifdef WITH_ASSISTANT
--- , Command.Watch.cmd
--- , Command.Assistant.cmd
+ , Command.Watch.cmd
+ , Command.Assistant.cmd
#ifdef WITH_WEBAPP
-- , Command.WebApp.cmd
#endif
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index f95a4d03e..a050f57e3 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -285,3 +285,19 @@ timeLimitOption = globalSetter Limit.addTimeLimit $ strOption
<> help "stop after the specified amount of time"
<> hidden
)
+
+data DaemonOptions = DaemonOptions
+ { foregroundDaemonOption :: Bool
+ , stopDaemonOption :: Bool
+ }
+
+parseDaemonOptions :: Parser DaemonOptions
+parseDaemonOptions = DaemonOptions
+ <$> switch
+ ( long "foreground"
+ <> help "do not daemonize"
+ )
+ <*> switch
+ ( long "stop"
+ <> help "stop daemon"
+ )