finished converting all the main options

This commit is contained in:
Joey Hess 2015-07-10 13:18:46 -04:00
parent 5cc882a35e
commit 6a4f2087be
22 changed files with 165 additions and 122 deletions

View file

@ -83,12 +83,12 @@ withOptions o c = c { cmdoptions = cmdoptions c ++ o }
{- Adds global options to a command's option parser, and modifies its seek
- option to first run actions for them.
-}
withGlobalOptions :: [Parser GlobalSetter] -> Command -> Command
withGlobalOptions :: [GlobalOption] -> Command -> Command
withGlobalOptions os c = c { cmdparser = apply <$> mixin (cmdparser c) }
where
mixin p = (,)
<$> p
<*> combineGlobalSetters os
<*> combineGlobalOptions os
apply (seek, globalsetters) = do
void $ getParsed globalsetters
seek