summaryrefslogtreecommitdiff
path: root/GitAnnex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-27 13:51:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-27 13:51:24 -0400
commitd010ee969c82d6bb2d0f60c4b1ce2de3543e0920 (patch)
treefef62e7155b8ae9977ce51294339693f548cd964 /GitAnnex.hs
parent3b1d7915569b0dbfa6cefc54e0537d19290e08bf (diff)
Per-command usage messages.
Diffstat (limited to 'GitAnnex.hs')
-rw-r--r--GitAnnex.hs53
1 files changed, 2 insertions, 51 deletions
diff --git a/GitAnnex.hs b/GitAnnex.hs
index 6a0139dce..b78493dfc 100644
--- a/GitAnnex.hs
+++ b/GitAnnex.hs
@@ -9,18 +9,10 @@
module GitAnnex where
-import System.Console.GetOpt
-
-import Common.Annex
-import qualified Git.Config
import qualified Git.CurrentRepo
import CmdLine
import Command
-import Types.TrustLevel
-import qualified Annex
-import qualified Remote
-import qualified Limit
-import qualified Option
+import GitAnnex.Options
import qualified Command.Add
import qualified Command.Unannex
@@ -145,49 +137,8 @@ cmds = concat
#endif
]
-options :: [Option]
-options = Option.common ++
- [ Option ['N'] ["numcopies"] (ReqArg setnumcopies paramNumber)
- "override default number of copies"
- , Option [] ["trust"] (trustArg Trusted)
- "override trust setting"
- , Option [] ["semitrust"] (trustArg SemiTrusted)
- "override trust setting back to default"
- , Option [] ["untrust"] (trustArg UnTrusted)
- "override trust setting to untrusted"
- , Option ['c'] ["config"] (ReqArg setgitconfig "NAME=VALUE")
- "override git configuration setting"
- , Option ['x'] ["exclude"] (ReqArg Limit.addExclude paramGlob)
- "skip files matching the glob pattern"
- , Option ['I'] ["include"] (ReqArg Limit.addInclude paramGlob)
- "don't skip files matching the glob pattern"
- , Option ['i'] ["in"] (ReqArg Limit.addIn paramRemote)
- "skip files not present in a remote"
- , Option ['C'] ["copies"] (ReqArg Limit.addCopies paramNumber)
- "skip files with fewer copies"
- , Option ['B'] ["inbackend"] (ReqArg Limit.addInBackend paramName)
- "skip files not using a key-value backend"
- , Option [] ["inallgroup"] (ReqArg Limit.addInAllGroup paramGroup)
- "skip files not present in all remotes in a group"
- , Option [] ["largerthan"] (ReqArg Limit.addLargerThan paramSize)
- "skip files larger than a size"
- , Option [] ["smallerthan"] (ReqArg Limit.addSmallerThan paramSize)
- "skip files smaller than a size"
- , Option ['T'] ["time-limit"] (ReqArg Limit.addTimeLimit paramTime)
- "stop after the specified amount of time"
- , Option [] ["trust-glacier"] (NoArg (Annex.setFlag "trustglacier"))
- "Trust Amazon Glacier inventory"
- ] ++ Option.matcher
- where
- setnumcopies v = maybe noop
- (\n -> Annex.changeGitConfig $ \c -> c { annexNumCopies = n })
- (readish v)
- setgitconfig v = Annex.changeGitRepo =<< inRepo (Git.Config.store v)
-
- trustArg t = ReqArg (Remote.forceTrust t) paramRemote
-
header :: String
-header = "Usage: git-annex command [option ..]"
+header = "git-annex command [option ...]"
run :: [String] -> IO ()
run args = dispatch True args cmds options [] header Git.CurrentRepo.get