refactor in preparation for adding a git-annex-shell command
This commit is contained in:
parent
6a5be9d53c
commit
a89a6f2114
24 changed files with 204 additions and 136 deletions
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue