summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-12-30 15:06:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-12-30 15:06:26 -0400
commita89a6f21145966e625b811741d8ae972a11d92b1 (patch)
tree4fa1a5828b9b787ac25ae057b402e74ac36979d1 /Command
parent6a5be9d53cad9ee2988c6d54001f387dfe1f2716 (diff)
refactor in preparation for adding a git-annex-shell command
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs4
-rw-r--r--Command/Copy.hs4
-rw-r--r--Command/Drop.hs4
-rw-r--r--Command/DropKey.hs4
-rw-r--r--Command/DropUnused.hs4
-rw-r--r--Command/Find.hs4
-rw-r--r--Command/Fix.hs4
-rw-r--r--Command/FromKey.hs4
-rw-r--r--Command/Fsck.hs4
-rw-r--r--Command/Get.hs4
-rw-r--r--Command/Init.hs4
-rw-r--r--Command/Lock.hs3
-rw-r--r--Command/Move.hs4
-rw-r--r--Command/PreCommit.hs3
-rw-r--r--Command/SetKey.hs4
-rw-r--r--Command/Trust.hs4
-rw-r--r--Command/Unannex.hs3
-rw-r--r--Command/Uninit.hs4
-rw-r--r--Command/Unlock.hs6
-rw-r--r--Command/Untrust.hs4
-rw-r--r--Command/Unused.hs3
21 files changed, 80 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 08a880206..bc869a67d 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -18,8 +18,8 @@ import Types
import Core
import Messages
-command :: Command
-command = Command "add" paramPath seek "add files to annex"
+command :: [Command]
+command = [Command "add" paramPath seek "add files to annex"]
{- Add acts on both files not checked into git yet, and unlocked files. -}
seek :: [CommandSeek]
diff --git a/Command/Copy.hs b/Command/Copy.hs
index 873df7ef2..93342e11b 100644
--- a/Command/Copy.hs
+++ b/Command/Copy.hs
@@ -10,6 +10,10 @@ module Command.Copy where
import Command
import qualified Command.Move
+command :: [Command]
+command = [Command "copy" paramPath seek
+ "copy content of files to/from another repository"]
+
-- A copy is just a move that does not delete the source file.
seek :: [CommandSeek]
seek = [withFilesInGit $ Command.Move.start False]
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 3f2740570..a425c6138 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -17,6 +17,10 @@ import Core
import Messages
import Utility
+command :: [Command]
+command = [Command "drop" paramPath seek
+ "indicate content of files not currently wanted"]
+
seek :: [CommandSeek]
seek = [withAttrFilesInGit "annex.numcopies" start]
diff --git a/Command/DropKey.hs b/Command/DropKey.hs
index 870e9a7ab..29056139d 100644
--- a/Command/DropKey.hs
+++ b/Command/DropKey.hs
@@ -15,6 +15,10 @@ import Types
import Core
import Messages
+command :: [Command]
+command = [Command "dropkey" (paramRepeating paramKey) seek
+ "drops annexed content for specified keys"]
+
seek :: [CommandSeek]
seek = [withKeys start]
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index 9984e49f3..ea2ff46eb 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -18,6 +18,10 @@ import qualified Annex
import qualified Command.Drop
import Backend
+command :: [Command]
+command = [Command "dropunused" (paramRepeating paramNumber) seek
+ "drop unused file content"]
+
seek :: [CommandSeek]
seek = [withStrings start]
diff --git a/Command/Find.hs b/Command/Find.hs
index 9927b692d..7cb781ce8 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -13,6 +13,10 @@ import Control.Monad.State (liftIO)
import Command
import Core
+command :: [Command]
+command = [Command "find" (paramOptional $ paramRepeating paramPath) seek
+ "lists available files"]
+
seek :: [CommandSeek]
seek = [withDefault "." withFilesInGit start]
diff --git a/Command/Fix.hs b/Command/Fix.hs
index accdadd31..8b08a26f6 100644
--- a/Command/Fix.hs
+++ b/Command/Fix.hs
@@ -17,6 +17,10 @@ import Utility
import Core
import Messages
+command :: [Command]
+command = [Command "fix" paramPath seek
+ "fix up symlinks to point to annexed content"]
+
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/FromKey.hs b/Command/FromKey.hs
index 991428136..f1cb717fa 100644
--- a/Command/FromKey.hs
+++ b/Command/FromKey.hs
@@ -20,6 +20,10 @@ import Types
import Core
import Messages
+command :: [Command]
+command = [Command "fromkey" (paramRepeating paramKey) seek
+ "adds a file using a specific key"]
+
seek :: [CommandSeek]
seek = [withFilesMissing start]
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 034bdc388..d870bd419 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -13,6 +13,10 @@ import Types
import Messages
import Utility
+command :: [Command]
+command = [Command "fsck" (paramOptional $ paramRepeating paramPath) seek
+ "check for problems"]
+
seek :: [CommandSeek]
seek = [withAll (withAttrFilesInGit "annex.numcopies") start]
diff --git a/Command/Get.hs b/Command/Get.hs
index 214b689b8..e3668649e 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -13,6 +13,10 @@ import Types
import Core
import Messages
+command :: [Command]
+command = [Command "get" paramPath seek
+ "make content of annexed files available"]
+
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/Init.hs b/Command/Init.hs
index 806c34c98..8ad9f79d7 100644
--- a/Command/Init.hs
+++ b/Command/Init.hs
@@ -19,6 +19,10 @@ import Version
import Messages
import Locations
import Types
+
+command :: [Command]
+command = [Command "init" paramDesc seek
+ "initialize git-annex with repository description"]
seek :: [CommandSeek]
seek = [withString start]
diff --git a/Command/Lock.hs b/Command/Lock.hs
index 381162536..00a553e95 100644
--- a/Command/Lock.hs
+++ b/Command/Lock.hs
@@ -14,6 +14,9 @@ import Command
import Messages
import qualified Annex
import qualified GitRepo as Git
+
+command :: [Command]
+command = [Command "lock" paramPath seek "undo unlock command"]
seek :: [CommandSeek]
seek = [withFilesUnlocked start]
diff --git a/Command/Move.hs b/Command/Move.hs
index 8ba8dbfac..addeeae8a 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -20,6 +20,10 @@ import qualified GitRepo as Git
import qualified Remotes
import UUID
import Messages
+
+command :: [Command]
+command = [Command "move" paramPath seek
+ "move content of files to/from another repository"]
seek :: [CommandSeek]
seek = [withFilesInGit $ start True]
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index 8d488514a..12e5ed806 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -15,6 +15,9 @@ import qualified GitRepo as Git
import qualified Command.Add
import qualified Command.Fix
+command :: [Command]
+command = [Command "pre-commit" paramPath seek "run by git pre-commit hook"]
+
{- The pre-commit hook needs to fix symlinks to all files being committed.
- And, it needs to inject unlocked files into the annex. -}
seek :: [CommandSeek]
diff --git a/Command/SetKey.hs b/Command/SetKey.hs
index 4c82de3a5..5048d052f 100644
--- a/Command/SetKey.hs
+++ b/Command/SetKey.hs
@@ -19,6 +19,10 @@ import Types
import Core
import Messages
+command :: [Command]
+command = [Command "setkey" (paramRepeating paramKey) seek
+ "sets annexed content for a key using a temp file"]
+
seek :: [CommandSeek]
seek = [withTempFile start]
diff --git a/Command/Trust.hs b/Command/Trust.hs
index 3c3ec3b7e..35ddefe84 100644
--- a/Command/Trust.hs
+++ b/Command/Trust.hs
@@ -17,6 +17,10 @@ import qualified Remotes
import UUID
import Messages
+command :: [Command]
+command = [Command "trust" (paramRepeating paramRemote) seek
+ "trust a repository"]
+
seek :: [CommandSeek]
seek = [withString start]
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 42354b8c4..288f9da44 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -20,6 +20,9 @@ import Core
import qualified GitRepo as Git
import Messages
+command :: [Command]
+command = [Command "unannex" paramPath seek "undo accidential add command"]
+
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index 6001c55cd..1a4e9b0d7 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -20,6 +20,10 @@ import qualified Annex
import qualified Command.Unannex
import qualified Command.Init
+command :: [Command]
+command = [Command "uninit" paramPath seek
+ "de-initialize git-annex and clean out repository"]
+
seek :: [CommandSeek]
seek = [withAll withFilesInGit Command.Unannex.start, withNothing start]
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 21f34d1db..0e55585ae 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -18,6 +18,12 @@ import Locations
import Core
import CopyFile
+command :: [Command]
+command =
+ [ Command "unlock" paramPath seek "unlock files for modification"
+ , Command "edit" paramPath seek "same as unlock"
+ ]
+
seek :: [CommandSeek]
seek = [withFilesInGit start]
diff --git a/Command/Untrust.hs b/Command/Untrust.hs
index 6458040b3..f49a2e989 100644
--- a/Command/Untrust.hs
+++ b/Command/Untrust.hs
@@ -17,6 +17,10 @@ import qualified Remotes
import UUID
import Messages
+command :: [Command]
+command = [Command "untrust" (paramRepeating paramRemote) seek
+ "do not trust a repository"]
+
seek :: [CommandSeek]
seek = [withString start]
diff --git a/Command/Unused.hs b/Command/Unused.hs
index dba9aa517..d2dfc9aa3 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -17,6 +17,9 @@ import Messages
import Locations
import qualified Annex
+command :: [Command]
+command = [Command "unused" paramNothing seek "look for unused file content"]
+
seek :: [CommandSeek]
seek = [withNothing start]