convert all commands to work with optparse-applicative

Still no options though.
This commit is contained in:
Joey Hess 2015-07-08 15:08:02 -04:00
parent 3125da54f6
commit 6e5c1f8db3
99 changed files with 391 additions and 297 deletions

View file

@ -21,8 +21,10 @@ import Data.Time.Clock.POSIX
import qualified Data.Map as M
cmd :: Command
cmd = withOptions [activityOption, noActOption] $ command "expire" paramExpire seek
SectionMaintenance "expire inactive repositories"
cmd = withOptions [activityOption, noActOption] $
command "expire" SectionMaintenance
"expire inactive repositories"
paramExpire (withParams seek)
paramExpire :: String
paramExpire = (paramRepeating $ paramOptional paramRemote ++ ":" ++ paramTime)
@ -33,7 +35,7 @@ activityOption = fieldOption [] "activity" "Name" "specify activity"
noActOption :: Option
noActOption = flagOption [] "no-act" "don't really do anything"
seek :: CommandSeek
seek :: CmdParams -> CommandSeek
seek ps = do
expire <- parseExpire ps
wantact <- getOptionField activityOption (pure . parseActivity)