converted Assistant and Watch; avoid duplicate arg parsing for no repo mode

This commit is contained in:
Joey Hess 2015-07-13 11:42:42 -04:00
parent 084f8d9ac7
commit b95a48fe45
6 changed files with 71 additions and 70 deletions

View file

@ -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"
)