summaryrefslogtreecommitdiff
path: root/GitAnnex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-01 17:49:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-01 17:57:31 -0400
commita8fb97d2ce8e75b36b8e1572a83efd341e67d43e (patch)
treeab24a8af581281ff8b006309acfb4000317ad072 /GitAnnex.hs
parent7a3d9d8c2e2bd53d0d4290e99186c6e37f18456d (diff)
Add --trust, --untrust, and --semitrust options.
Diffstat (limited to 'GitAnnex.hs')
-rw-r--r--GitAnnex.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/GitAnnex.hs b/GitAnnex.hs
index 37a73424a..64b0888b0 100644
--- a/GitAnnex.hs
+++ b/GitAnnex.hs
@@ -14,6 +14,7 @@ import CmdLine
import Command
import Options
import Utility
+import TrustLevel
import qualified Annex
import qualified Command.Add
@@ -83,7 +84,9 @@ cmds = concat
options :: [Option]
options = commonOptions ++
- [ Option ['t'] ["to"] (ReqArg setto paramRemote)
+ [ Option ['k'] ["key"] (ReqArg setkey paramKey)
+ "specify a key to use"
+ , Option ['t'] ["to"] (ReqArg setto paramRemote)
"specify to where to transfer content"
, Option ['f'] ["from"] (ReqArg setfrom paramRemote)
"specify from where to transfer content"
@@ -91,8 +94,12 @@ options = commonOptions ++
"skip files matching the glob pattern"
, Option ['N'] ["numcopies"] (ReqArg setnumcopies paramNumber)
"override default number of copies"
- , Option ['k'] ["key"] (ReqArg setkey paramKey)
- "specify a key to use"
+ , Option [] ["trust"] (ReqArg (settrust Trusted) paramRemote)
+ "override trust setting"
+ , Option [] ["semitrust"] (ReqArg (settrust SemiTrusted) paramRemote)
+ "override trust setting back to default value"
+ , Option [] ["untrust"] (ReqArg (settrust UnTrusted) paramRemote)
+ "override trust setting to untrusted"
]
where
setto v = Annex.changeState $ \s -> s { Annex.toremote = Just v }
@@ -100,6 +107,7 @@ options = commonOptions ++
addexclude v = Annex.changeState $ \s -> s { Annex.exclude = v:(Annex.exclude s) }
setnumcopies v = Annex.changeState $ \s -> s {Annex.forcenumcopies = readMaybe v }
setkey v = Annex.changeState $ \s -> s { Annex.defaultkey = Just v }
+ settrust t v = Annex.changeState $ \s -> s { Annex.forcetrust = (v, t):(Annex.forcetrust s) }
header :: String
header = "Usage: git-annex command [option ..]"