refactoring and cleanup
No code changes.
This commit is contained in:
parent
ef5330120c
commit
4e9be0d1f8
12 changed files with 288 additions and 210 deletions
12
Config.hs
12
Config.hs
|
@ -10,6 +10,7 @@ module Config where
|
|||
import Common.Annex
|
||||
import qualified Git
|
||||
import qualified Annex
|
||||
import Types.Key (readKey)
|
||||
|
||||
type ConfigKey = String
|
||||
|
||||
|
@ -92,3 +93,14 @@ getNumCopies v =
|
|||
return $ read $ Git.configGet g config "1"
|
||||
config = "annex.numcopies"
|
||||
|
||||
{- The Key specified by the --key parameter. -}
|
||||
cmdlineKey :: Annex Key
|
||||
cmdlineKey = do
|
||||
k <- Annex.getState Annex.defaultkey
|
||||
case k of
|
||||
Nothing -> nokey
|
||||
Just "" -> nokey
|
||||
Just kstring -> maybe badkey return $ readKey kstring
|
||||
where
|
||||
nokey = error "please specify the key with --key"
|
||||
badkey = error "bad key"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue