diff options
author | 2010-10-14 21:10:59 -0400 | |
---|---|---|
committer | 2010-10-14 21:10:59 -0400 | |
commit | 29039fdf97f541a1077c9af65ccbe09dd2ae2b28 (patch) | |
tree | d46d1c1489422352df166789cf9baeb56132501b /Annex.hs | |
parent | 4c3ad80f320d3c4cccc3e41e4f2364155bae22a1 (diff) |
add flags, and change to subcommand style
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -7,6 +7,9 @@ module Annex ( gitRepoChange, backends, backendsChange, + flagIsSet, + flagsChange, + Flag(..) ) where import Control.Monad.State @@ -18,7 +21,11 @@ import qualified BackendTypes as Backend -} new :: Git.Repo -> IO AnnexState new g = do - let s = Backend.AnnexState { Backend.repo = g, Backend.backends = [] } + let s = Backend.AnnexState { + Backend.repo = g, + Backend.backends = [], + Backend.flags = [] + } (_,s') <- Annex.run s (prep g) return s' where @@ -49,3 +56,12 @@ backendsChange b = do state <- get put state { Backend.backends = b } return () +flagIsSet :: Flag -> Annex Bool +flagIsSet flag = do + state <- get + return $ elem flag $ Backend.flags state +flagsChange :: [Flag] -> Annex () +flagsChange b = do + state <- get + put state { Backend.flags = b } + return () |