summaryrefslogtreecommitdiff
path: root/Command/Expire.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-08 15:08:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-08 15:08:02 -0400
commite7e61fb6cbe5455ded9bb550a64121223c099fc2 (patch)
tree003a99697256ea516ad40f9fbdb854996b58c0cd /Command/Expire.hs
parent8879c96d157f06bbd2372064251676b7927ce38e (diff)
convert all commands to work with optparse-applicative
Still no options though.
Diffstat (limited to 'Command/Expire.hs')
-rw-r--r--Command/Expire.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Expire.hs b/Command/Expire.hs
index 44bdd113f..9552128f1 100644
--- a/Command/Expire.hs
+++ b/Command/Expire.hs
@@ -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)