Not yet used .. mindless train work.
import Annex.CheckAttr
{- Generates a normal command -}
-command :: String -> String -> [CommandSeek] -> String -> Command
+command :: String -> String -> [CommandSeek] -> CommandSection -> String -> Command
command = Command [] Nothing commonChecks False
{- Indicates that a command doesn't need to commit any changes to
import Utility.InodeCache
def :: [Command]
-def = [notBareRepo $ command "add" paramPaths seek "add files to annex"]
+def = [notBareRepo $ command "add" paramPaths seek SectionCommon
+ "add files to annex"]
{- Add acts on both files not checked into git yet, and unlocked files.
-
def :: [Command]
def = [notDirect $ command "addunused" (paramRepeating paramNumRange)
- seek "add back unused files"]
+ seek SectionMaintenance "add back unused files"]
seek :: [CommandSeek]
seek = [withUnusedMaps start]
def :: [Command]
def = [notBareRepo $ withOptions [fileOption, pathdepthOption, relaxedOption] $
- command "addurl" (paramRepeating paramUrl) seek "add urls to annex"]
+ command "addurl" (paramRepeating paramUrl) seek
+ SectionCommon "add urls to annex"]
fileOption :: Option
fileOption = Option.field [] "file" paramFile "specify what file the url is added to"
def :: [Command]
def = [noRepo checkAutoStart $ dontCheck repoExists $
withOptions [Command.Watch.foregroundOption, Command.Watch.stopOption, autoStartOption] $
- command "assistant" paramNothing seek "automatically handle changes"]
+ command "assistant" paramNothing seek SectionCommon
+ "automatically handle changes"]
autoStartOption :: Option
autoStartOption = Option.flag [] "autostart" "start in known repositories"
def :: [Command]
def = [command "commit" paramNothing seek
- "commits any staged changes to the git-annex branch"]
+ SectionPlumbing "commits any staged changes to the git-annex branch"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [noCommit $ command "configlist" paramNothing seek
- "outputs relevant git configuration"]
+ SectionPlumbing "outputs relevant git configuration"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [withOptions Command.Move.options $ command "copy" paramPaths seek
- "copy content of files to/from another repository"]
+ SectionCommon "copy content of files to/from another repository"]
seek :: [CommandSeek]
seek = [withField Command.Move.toOption Remote.byNameWithUUID $ \to ->
def :: [Command]
def = [command "dead" (paramRepeating paramRemote) seek
- "hide a lost repository"]
+ SectionSetup "hide a lost repository"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [command "describe" (paramPair paramRemote paramDesc) seek
- "change description of a repository"]
+ SectionSetup "change description of a repository"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [notBareRepo $
- command "direct" paramNothing seek "switch repository to direct mode"]
+ command "direct" paramNothing seek
+ SectionSetup "switch repository to direct mode"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [withOptions [fromOption] $ command "drop" paramPaths seek
- "indicate content of files not currently wanted"]
+ SectionCommon "indicate content of files not currently wanted"]
fromOption :: Option
fromOption = Option.field ['f'] "from" paramRemote "drop content from a remote"
def :: [Command]
def = [noCommit $ command "dropkey" (paramRepeating paramKey) seek
- "drops annexed content for specified keys"]
+ SectionPlumbing "drops annexed content for specified keys"]
seek :: [CommandSeek]
seek = [withKeys start]
def :: [Command]
def = [withOptions [Command.Drop.fromOption] $
command "dropunused" (paramRepeating paramNumRange)
- seek "drop unused file content"]
+ seek SectionMaintenance "drop unused file content"]
seek :: [CommandSeek]
seek = [withUnusedMaps start]
def :: [Command]
def = [noCommit $ withOptions [formatOption, print0Option] $
- command "find" paramPaths seek "lists available files"]
+ command "find" paramPaths seek SectionQuery "lists available files"]
formatOption :: Option
formatOption = Option.field [] "format" paramFormat "control format of output"
def :: [Command]
def = [notDirect $ noCommit $ command "fix" paramPaths seek
- "fix up symlinks to point to annexed content"]
+ SectionMaintenance "fix up symlinks to point to annexed content"]
seek :: [CommandSeek]
seek = [withFilesInGit $ whenAnnexed start]
def :: [Command]
def = [notDirect $ notBareRepo $
command "fromkey" (paramPair paramKey paramPath) seek
- "adds a file using a specific key"]
+ SectionPlumbing "adds a file using a specific key"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [withOptions options $ command "fsck" paramPaths seek
- "check for problems"]
+ SectionMaintenance "check for problems"]
fromOption :: Option
fromOption = Option.field ['f'] "from" paramRemote "check remote"
def :: [Command]
def = [withOptions [Command.Move.fromOption] $ command "get" paramPaths seek
- "make content of annexed files available"]
+ SectionCommon "make content of annexed files available"]
seek :: [CommandSeek]
seek = [withField Command.Move.fromOption Remote.byNameWithUUID $ \from ->
import qualified Data.Set as S
def :: [Command]
-def = [command "group" (paramPair paramRemote paramDesc) seek "add a repository to a group"]
+def = [command "group" (paramPair paramRemote paramDesc) seek
+ SectionCommon "add a repository to a group"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [noCommit $ noRepo showHelp $ dontCheck repoExists $
- command "help" paramNothing seek "display help"]
+ command "help" paramNothing seek SectionUtility "display help"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [notDirect $ notBareRepo $ command "import" paramPaths seek
- "move and add files from outside git working copy"]
+ SectionCommon "move and add files from outside git working copy"]
seek :: [CommandSeek]
seek = [withPathContents start]
def :: [Command]
def = [noCommit $ command "inannex" (paramRepeating paramKey) seek
- "checks if keys are present in the annex"]
+ SectionPlumbing "checks if keys are present in the annex"]
seek :: [CommandSeek]
seek = [withKeys start]
def :: [Command]
def = [notBareRepo $ command "indirect" paramNothing seek
- "switch repository to indirect mode"]
+ SectionSetup "switch repository to indirect mode"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [dontCheck repoExists $
- command "init" paramDesc seek "initialize git-annex"]
+ command "init" paramDesc seek SectionSetup "initialize git-annex"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [command "initremote"
(paramPair paramName $ paramOptional $ paramRepeating paramKeyValue)
- seek "sets up a special (non-git) remote"]
+ seek SectionSetup "sets up a special (non-git) remote"]
seek :: [CommandSeek]
seek = [withWords start]
import qualified Annex.Queue
def :: [Command]
-def = [notDirect $ command "lock" paramPaths seek "undo unlock command"]
+def = [notDirect $ command "lock" paramPaths seek SectionCommon
+ "undo unlock command"]
seek :: [CommandSeek]
seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start]
def :: [Command]
def = [withOptions options $
- command "log" paramPaths seek "shows location log"]
+ command "log" paramPaths seek SectionQuery "shows location log"]
options :: [Option]
options = passthruOptions ++ [gourceOption]
def :: [Command]
def = [dontCheck repoExists $
- command "map" paramNothing seek "generate map of repositories"]
+ command "map" paramNothing seek SectionQuery
+ "generate map of repositories"]
seek :: [CommandSeek]
seek = [withNothing start]
import qualified Annex.Branch
def :: [Command]
-def = [command "merge" paramNothing seek
- "auto-merge remote changes into git-annex branch"]
+def = [command "merge" paramNothing seek SectionMaintenance
+ "auto-merge remote changes into git-annex branch"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [notDirect $
- command "migrate" paramPaths seek "switch data to different backend"]
+ command "migrate" paramPaths seek
+ SectionUtility "switch data to different backend"]
seek :: [CommandSeek]
seek = [withFilesInGit $ whenAnnexed start]
def :: [Command]
def = [withOptions options $ command "move" paramPaths seek
- "move content of files to/from another repository"]
+ SectionCommon "move content of files to/from another repository"]
fromOption :: Option
fromOption = Option.field ['f'] "from" paramRemote "source remote"
import Git.Sha
def :: [Command]
-def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
+def = [command "pre-commit" paramPaths seek SectionPlumbing
+ "run by git pre-commit hook"]
seek :: [CommandSeek]
seek =
def :: [Command]
def = [notDirect $ command "rekey"
(paramOptional $ paramRepeating $ paramPair paramPath paramKey)
- seek "change keys used for files"]
+ seek SectionPlumbing "change keys used for files"]
seek :: [CommandSeek]
seek = [withPairs start]
def :: [Command]
def = [noCommit $ command "recvkey" paramKey seek
- "runs rsync in server mode to receive content"]
+ SectionPlumbing "runs rsync in server mode to receive content"]
seek :: [CommandSeek]
seek = [withKeys start]
def :: [Command]
def = [notDirect $ command "reinject" (paramPair "SRC" "DEST") seek
- "sets content of annexed file"]
+ SectionUtility "sets content of annexed file"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [command "semitrust" (paramRepeating paramRemote) seek
- "return repository to default trust level"]
+ SectionSetup "return repository to default trust level"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [noCommit $ command "sendkey" paramKey seek
- "runs rsync in server mode to send content"]
+ SectionPlumbing "runs rsync in server mode to send content"]
seek :: [CommandSeek]
seek = [withKeys start]
def :: [Command]
def = [command "status" (paramOptional paramPaths) seek
- "shows status information about the annex"]
+ SectionQuery "shows status information about the annex"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [command "sync" (paramOptional (paramRepeating paramRemote))
- [seek] "synchronize local repository with remotes"]
+ [seek] SectionCommon "synchronize local repository with remotes"]
-- syncing involves several operations, any of which can independently fail
seek :: CommandSeek
def :: [Command]
def = [ dontCheck repoExists $
- command "test" paramNothing seek "run built-in test suite"]
+ command "test" paramNothing seek SectionPlumbing
+ "run built-in test suite"]
seek :: [CommandSeek]
seek = [withWords start]
import qualified Fields
def :: [Command]
-def = [noCommit $ command "transferinfo" paramKey seek
+def = [noCommit $ command "transferinfo" paramKey seek SectionPlumbing
"updates sender on number of bytes of content received"]
seek :: [CommandSeek]
def :: [Command]
def = [withOptions options $
- noCommit $ command "transferkey" paramKey seek
+ noCommit $ command "transferkey" paramKey seek SectionPlumbing
"transfers a key from or to a remote"]
options :: [Option]
def :: [Command]
def = [withOptions options $
- command "transferkeys" paramNothing seek "plumbing; transfers keys"]
+ command "transferkeys" paramNothing seek
+ SectionPlumbing "transfers keys"]
options :: [Option]
options = [readFdOption, writeFdOption]
import Logs.Trust
def :: [Command]
-def = [command "trust" (paramRepeating paramRemote) seek "trust a repository"]
+def = [command "trust" (paramRepeating paramRemote) seek
+ SectionSetup "trust a repository"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [notDirect $
- command "unannex" paramPaths seek "undo accidential add command"]
+ command "unannex" paramPaths seek SectionUtility
+ "undo accidential add command"]
seek :: [CommandSeek]
seek = [withFilesInGit $ whenAnnexed start]
import qualified Data.Set as S
def :: [Command]
-def = [command "ungroup" (paramPair paramRemote paramDesc) seek "remove a repository from a group"]
+def = [command "ungroup" (paramPair paramRemote paramDesc) seek
+ SectionSetup "remove a repository from a group"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [notDirect $ addCheck check $ command "uninit" paramPaths seek
- "de-initialize git-annex and clean out repository"]
+ SectionUtility "de-initialize git-annex and clean out repository"]
check :: Annex ()
check = do
, c "edit" "same as unlock"
]
where
- c n = notDirect . command n paramPaths seek
+ c n = notDirect . command n paramPaths seek SectionCommon
seek :: [CommandSeek]
seek = [withFilesInGit $ whenAnnexed start]
def :: [Command]
def = [command "untrust" (paramRepeating paramRemote) seek
- "do not trust a repository"]
+ SectionSetup "do not trust a repository"]
seek :: [CommandSeek]
seek = [withWords start]
def :: [Command]
def = [withOptions [fromOption] $ command "unused" paramNothing seek
- "look for unused file content"]
+ SectionMaintenance "look for unused file content"]
fromOption :: Option
fromOption = Option.field ['f'] "from" paramRemote "remote to check for unused content"
def :: [Command]
def = [dontCheck repoExists $ -- because an old version may not seem to exist
- command "upgrade" paramNothing seek "upgrade repository layout"]
+ command "upgrade" paramNothing seek
+ SectionMaintenance "upgrade repository layout"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [noCommit $ noRepo showPackageVersion $ dontCheck repoExists $
- command "version" paramNothing seek "show version info"]
+ command "version" paramNothing seek SectionQuery "show version info"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [command "vicfg" paramNothing seek
- "edit git-annex's configuration"]
+ SectionSetup "edit git-annex's configuration"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [notBareRepo $ withOptions [foregroundOption, stopOption] $
- command "watch" paramNothing seek "watch for changes"]
+ command "watch" paramNothing seek SectionCommon "watch for changes"]
seek :: [CommandSeek]
seek = [withFlag stopOption $ \stopdaemon ->
def :: [Command]
def = [noCommit $ noRepo startNoRepo $ dontCheck repoExists $ notBareRepo $
- command "webapp" paramNothing seek "launch webapp"]
+ command "webapp" paramNothing seek SectionCommon "launch webapp"]
seek :: [CommandSeek]
seek = [withNothing start]
def :: [Command]
def = [noCommit $ command "whereis" paramPaths seek
- "lists repositories that have file content"]
+ SectionQuery "lists repositories that have file content"]
seek :: [CommandSeek]
seek = [withValue (remoteMap id) $ \m ->
def :: [Command]
def = [noCommit $ noRepo xmppGitRelay $ dontCheck repoExists $
- command "xmppgit" paramNothing seek "git to XMPP relay (internal use)"]
+ command "xmppgit" paramNothing seek
+ SectionPlumbing "git to XMPP relay"]
seek :: [CommandSeek]
seek = [withWords start]
, cmdname :: String
, cmdparamdesc :: String -- description of params for usage
, cmdseek :: [CommandSeek] -- seek stage
+ , cmdsection :: CommandSection
, cmddesc :: String -- description of command for usage
}
{- Order commands by name -}
instance Ord Command where
compare = comparing cmdname
+
+{- The same sections are listed in doc/git-annex.mdwn -}
+data CommandSection
+ = SectionCommon
+ | SectionSetup
+ | SectionMaintenance
+ | SectionQuery
+ | SectionUtility
+ | SectionPlumbing
+ deriving (Eq, Ord, Enum, Bounded)