2011-01-07 00:26:57 +00:00
|
|
|
{- git-annex main program
|
|
|
|
-
|
2015-07-13 17:19:20 +00:00
|
|
|
- Copyright 2010-2015 Joey Hess <id@joeyh.name>
|
2011-01-07 00:26:57 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
2013-11-06 20:33:45 +00:00
|
|
|
{-# LANGUAGE CPP, OverloadedStrings #-}
|
2012-06-26 13:15:47 +00:00
|
|
|
|
2014-01-26 20:25:55 +00:00
|
|
|
module CmdLine.GitAnnex where
|
2011-01-07 00:26:57 +00:00
|
|
|
|
2012-05-18 22:20:53 +00:00
|
|
|
import qualified Git.CurrentRepo
|
2011-01-07 06:15:10 +00:00
|
|
|
import CmdLine
|
2011-01-07 00:26:57 +00:00
|
|
|
import Command
|
2014-04-12 19:59:34 +00:00
|
|
|
import Utility.Env
|
|
|
|
import Annex.Ssh
|
2015-07-13 17:19:20 +00:00
|
|
|
import Types.Test
|
2011-01-07 00:26:57 +00:00
|
|
|
|
2015-07-10 20:32:33 +00:00
|
|
|
import qualified Command.Help
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.Add
|
|
|
|
import qualified Command.Unannex
|
|
|
|
import qualified Command.Drop
|
|
|
|
import qualified Command.Move
|
|
|
|
import qualified Command.Copy
|
|
|
|
import qualified Command.Get
|
2015-07-09 19:23:14 +00:00
|
|
|
import qualified Command.Fsck
|
2015-07-12 00:43:45 +00:00
|
|
|
import qualified Command.LookupKey
|
|
|
|
import qualified Command.ContentLocation
|
|
|
|
import qualified Command.ExamineKey
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.FromKey
|
2015-03-15 18:37:33 +00:00
|
|
|
import qualified Command.RegisterUrl
|
2015-07-02 21:44:25 +00:00
|
|
|
import qualified Command.SetKey
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.DropKey
|
2012-08-24 21:23:58 +00:00
|
|
|
import qualified Command.TransferKey
|
2013-03-19 20:58:36 +00:00
|
|
|
import qualified Command.TransferKeys
|
2014-12-29 19:16:40 +00:00
|
|
|
import qualified Command.SetPresentKey
|
2015-03-20 15:22:27 +00:00
|
|
|
import qualified Command.ReadPresentKey
|
2015-03-20 15:44:46 +00:00
|
|
|
import qualified Command.CheckPresentKey
|
2012-02-16 20:36:35 +00:00
|
|
|
import qualified Command.ReKey
|
2015-07-12 13:25:43 +00:00
|
|
|
import qualified Command.MetaData
|
2014-02-18 21:38:23 +00:00
|
|
|
import qualified Command.View
|
2014-02-19 00:01:56 +00:00
|
|
|
import qualified Command.VAdd
|
add tip about metadata driven views (and more flexible view filtering)
While writing this documentation, I realized that there needed to be a way
to stay in a view like tag=* while adding a filter like tag=work that
applies to the same field.
So, there are really two ways a view can be refined. It can have a new
"field=explicitvalue" filter added to it, which does not change the
"shape" of the view, but narrows the files it shows.
Or, it can have a new view added, which adds another level of
subdirectories.
So, added a vfilter command, which takes explicit values to add to the
filter, and rejects changes that would change the shape of the view.
And, made vadd only accept changes that change the shape of the view.
And, changed the View data type slightly; now components that can match
multiple metadata values can be visible, or not visible.
This commit was sponsored by Stelian Iancu.
2014-02-19 19:10:18 +00:00
|
|
|
import qualified Command.VFilter
|
2014-02-18 21:38:23 +00:00
|
|
|
import qualified Command.VPop
|
2014-02-19 00:16:28 +00:00
|
|
|
import qualified Command.VCycle
|
2011-10-31 19:18:41 +00:00
|
|
|
import qualified Command.Reinject
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.Fix
|
|
|
|
import qualified Command.Init
|
2011-03-03 21:21:00 +00:00
|
|
|
import qualified Command.Describe
|
2011-03-29 03:22:31 +00:00
|
|
|
import qualified Command.InitRemote
|
2013-04-26 22:22:44 +00:00
|
|
|
import qualified Command.EnableRemote
|
2015-07-10 20:26:23 +00:00
|
|
|
import qualified Command.Expire
|
2013-10-23 16:21:59 +00:00
|
|
|
import qualified Command.Repair
|
2015-07-10 20:05:56 +00:00
|
|
|
import qualified Command.Unused
|
2015-07-10 20:15:31 +00:00
|
|
|
import qualified Command.DropUnused
|
2012-05-02 18:59:05 +00:00
|
|
|
import qualified Command.AddUnused
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.Unlock
|
|
|
|
import qualified Command.Lock
|
|
|
|
import qualified Command.PreCommit
|
2015-07-10 16:47:35 +00:00
|
|
|
import qualified Command.Find
|
2015-07-11 00:38:11 +00:00
|
|
|
import qualified Command.FindRef
|
2015-07-10 20:32:33 +00:00
|
|
|
import qualified Command.Whereis
|
2015-07-11 00:46:48 +00:00
|
|
|
import qualified Command.List
|
2015-07-13 14:44:51 +00:00
|
|
|
import qualified Command.Log
|
2011-06-22 22:46:45 +00:00
|
|
|
import qualified Command.Merge
|
2014-07-11 20:45:18 +00:00
|
|
|
import qualified Command.ResolveMerge
|
2015-07-11 14:41:52 +00:00
|
|
|
import qualified Command.Info
|
2015-07-11 14:42:46 +00:00
|
|
|
import qualified Command.Status
|
2011-01-08 19:54:14 +00:00
|
|
|
import qualified Command.Migrate
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.Uninit
|
2014-04-16 00:13:35 +00:00
|
|
|
import qualified Command.Reinit
|
2014-01-20 20:47:56 +00:00
|
|
|
import qualified Command.NumCopies
|
2011-01-07 00:26:57 +00:00
|
|
|
import qualified Command.Trust
|
|
|
|
import qualified Command.Untrust
|
2011-01-26 19:37:16 +00:00
|
|
|
import qualified Command.Semitrust
|
2015-07-13 14:26:54 +00:00
|
|
|
import qualified Command.Dead
|
2012-10-01 19:12:04 +00:00
|
|
|
import qualified Command.Group
|
2013-10-28 18:08:38 +00:00
|
|
|
import qualified Command.Wanted
|
2015-02-06 19:12:42 +00:00
|
|
|
import qualified Command.GroupWanted
|
2015-04-18 20:04:25 +00:00
|
|
|
import qualified Command.Required
|
2013-10-13 19:40:38 +00:00
|
|
|
import qualified Command.Schedule
|
2012-10-01 19:12:04 +00:00
|
|
|
import qualified Command.Ungroup
|
2015-07-11 00:40:30 +00:00
|
|
|
import qualified Command.Vicfg
|
2011-12-10 00:27:22 +00:00
|
|
|
import qualified Command.Sync
|
2015-07-11 01:05:34 +00:00
|
|
|
import qualified Command.Mirror
|
2015-07-13 14:57:49 +00:00
|
|
|
import qualified Command.AddUrl
|
2013-07-28 19:27:36 +00:00
|
|
|
#ifdef WITH_FEED
|
2015-07-13 15:06:41 +00:00
|
|
|
import qualified Command.ImportFeed
|
2013-07-28 19:27:36 +00:00
|
|
|
#endif
|
2013-04-22 21:18:53 +00:00
|
|
|
import qualified Command.RmUrl
|
2015-07-13 15:15:21 +00:00
|
|
|
import qualified Command.Import
|
2011-02-03 22:55:12 +00:00
|
|
|
import qualified Command.Map
|
2012-12-13 19:44:56 +00:00
|
|
|
import qualified Command.Direct
|
|
|
|
import qualified Command.Indirect
|
2011-03-16 19:48:26 +00:00
|
|
|
import qualified Command.Upgrade
|
2015-07-11 04:42:32 +00:00
|
|
|
import qualified Command.Forget
|
2014-11-12 19:41:15 +00:00
|
|
|
import qualified Command.Proxy
|
2014-11-24 20:14:01 +00:00
|
|
|
import qualified Command.DiffDriver
|
2015-07-11 04:42:32 +00:00
|
|
|
import qualified Command.Undo
|
2011-03-19 18:33:24 +00:00
|
|
|
import qualified Command.Version
|
2012-06-26 13:15:47 +00:00
|
|
|
#ifdef WITH_ASSISTANT
|
2015-07-13 15:42:42 +00:00
|
|
|
import qualified Command.Watch
|
|
|
|
import qualified Command.Assistant
|
2012-07-26 03:13:01 +00:00
|
|
|
#ifdef WITH_WEBAPP
|
2015-07-13 15:53:42 +00:00
|
|
|
import qualified Command.WebApp
|
2012-07-26 03:13:01 +00:00
|
|
|
#endif
|
2012-11-06 04:52:35 +00:00
|
|
|
#ifdef WITH_XMPP
|
|
|
|
import qualified Command.XMPPGit
|
|
|
|
#endif
|
2014-04-06 23:06:03 +00:00
|
|
|
import qualified Command.RemoteDaemon
|
2012-06-26 13:15:47 +00:00
|
|
|
#endif
|
2014-08-01 19:09:49 +00:00
|
|
|
import qualified Command.Test
|
2014-08-24 01:46:08 +00:00
|
|
|
#ifdef WITH_TESTSUITE
|
2013-05-23 23:00:46 +00:00
|
|
|
import qualified Command.FuzzTest
|
2015-07-11 04:42:32 +00:00
|
|
|
import qualified Command.TestRemote
|
2013-02-27 19:59:31 +00:00
|
|
|
#endif
|
2013-11-06 20:33:45 +00:00
|
|
|
#ifdef WITH_EKG
|
|
|
|
import System.Remote.Monitoring
|
|
|
|
#endif
|
2011-01-07 00:26:57 +00:00
|
|
|
|
2015-07-13 17:19:20 +00:00
|
|
|
cmds :: Parser TestOptions -> Maybe TestRunner -> [Command]
|
|
|
|
cmds testoptparser testrunner =
|
2015-07-10 20:32:33 +00:00
|
|
|
[ Command.Help.cmd
|
|
|
|
, Command.Add.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Get.cmd
|
|
|
|
, Command.Drop.cmd
|
|
|
|
, Command.Move.cmd
|
|
|
|
, Command.Copy.cmd
|
2015-07-09 19:23:14 +00:00
|
|
|
, Command.Fsck.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Unlock.cmd
|
2015-07-08 16:33:27 +00:00
|
|
|
, Command.Unlock.editcmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Lock.cmd
|
|
|
|
, Command.Sync.cmd
|
2015-07-11 01:05:34 +00:00
|
|
|
, Command.Mirror.cmd
|
2015-07-13 14:57:49 +00:00
|
|
|
, Command.AddUrl.cmd
|
2013-07-28 19:27:36 +00:00
|
|
|
#ifdef WITH_FEED
|
2015-07-13 15:06:41 +00:00
|
|
|
, Command.ImportFeed.cmd
|
2013-07-28 19:27:36 +00:00
|
|
|
#endif
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.RmUrl.cmd
|
2015-07-13 15:15:21 +00:00
|
|
|
, Command.Import.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Init.cmd
|
|
|
|
, Command.Describe.cmd
|
|
|
|
, Command.InitRemote.cmd
|
|
|
|
, Command.EnableRemote.cmd
|
|
|
|
, Command.Reinject.cmd
|
|
|
|
, Command.Unannex.cmd
|
|
|
|
, Command.Uninit.cmd
|
|
|
|
, Command.Reinit.cmd
|
|
|
|
, Command.PreCommit.cmd
|
|
|
|
, Command.NumCopies.cmd
|
|
|
|
, Command.Trust.cmd
|
|
|
|
, Command.Untrust.cmd
|
|
|
|
, Command.Semitrust.cmd
|
2015-07-13 14:26:54 +00:00
|
|
|
, Command.Dead.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Group.cmd
|
|
|
|
, Command.Wanted.cmd
|
2015-02-06 19:12:42 +00:00
|
|
|
, Command.GroupWanted.cmd
|
2015-04-18 20:04:25 +00:00
|
|
|
, Command.Required.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Schedule.cmd
|
|
|
|
, Command.Ungroup.cmd
|
2015-07-11 00:40:30 +00:00
|
|
|
, Command.Vicfg.cmd
|
2015-07-12 00:43:45 +00:00
|
|
|
, Command.LookupKey.cmd
|
|
|
|
, Command.ContentLocation.cmd
|
|
|
|
, Command.ExamineKey.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.FromKey.cmd
|
2015-03-15 18:55:44 +00:00
|
|
|
, Command.RegisterUrl.cmd
|
2015-07-02 21:44:25 +00:00
|
|
|
, Command.SetKey.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.DropKey.cmd
|
|
|
|
, Command.TransferKey.cmd
|
|
|
|
, Command.TransferKeys.cmd
|
2014-12-29 19:16:40 +00:00
|
|
|
, Command.SetPresentKey.cmd
|
2015-03-20 15:22:27 +00:00
|
|
|
, Command.ReadPresentKey.cmd
|
2015-03-20 15:44:46 +00:00
|
|
|
, Command.CheckPresentKey.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.ReKey.cmd
|
2015-07-12 13:25:43 +00:00
|
|
|
, Command.MetaData.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.View.cmd
|
|
|
|
, Command.VAdd.cmd
|
|
|
|
, Command.VFilter.cmd
|
|
|
|
, Command.VPop.cmd
|
|
|
|
, Command.VCycle.cmd
|
|
|
|
, Command.Fix.cmd
|
2015-07-10 20:26:23 +00:00
|
|
|
, Command.Expire.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Repair.cmd
|
2015-07-10 20:05:56 +00:00
|
|
|
, Command.Unused.cmd
|
2015-07-10 20:15:31 +00:00
|
|
|
, Command.DropUnused.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.AddUnused.cmd
|
2015-07-10 16:47:35 +00:00
|
|
|
, Command.Find.cmd
|
2015-07-11 00:38:11 +00:00
|
|
|
, Command.FindRef.cmd
|
2015-07-10 20:32:33 +00:00
|
|
|
, Command.Whereis.cmd
|
2015-07-11 00:46:48 +00:00
|
|
|
, Command.List.cmd
|
2015-07-13 14:44:51 +00:00
|
|
|
, Command.Log.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Merge.cmd
|
|
|
|
, Command.ResolveMerge.cmd
|
2015-07-11 14:41:52 +00:00
|
|
|
, Command.Info.cmd
|
2015-07-11 14:42:46 +00:00
|
|
|
, Command.Status.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Migrate.cmd
|
|
|
|
, Command.Map.cmd
|
|
|
|
, Command.Direct.cmd
|
|
|
|
, Command.Indirect.cmd
|
|
|
|
, Command.Upgrade.cmd
|
2015-07-11 04:42:32 +00:00
|
|
|
, Command.Forget.cmd
|
2014-11-12 19:41:15 +00:00
|
|
|
, Command.Proxy.cmd
|
2014-11-24 20:14:01 +00:00
|
|
|
, Command.DiffDriver.cmd
|
2015-07-11 04:42:32 +00:00
|
|
|
, Command.Undo.cmd
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.Version.cmd
|
2012-06-26 13:15:47 +00:00
|
|
|
#ifdef WITH_ASSISTANT
|
2015-07-13 15:42:42 +00:00
|
|
|
, Command.Watch.cmd
|
|
|
|
, Command.Assistant.cmd
|
2012-07-26 03:13:01 +00:00
|
|
|
#ifdef WITH_WEBAPP
|
2015-07-13 15:53:42 +00:00
|
|
|
, Command.WebApp.cmd
|
2012-07-26 03:13:01 +00:00
|
|
|
#endif
|
2012-11-06 04:52:35 +00:00
|
|
|
#ifdef WITH_XMPP
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.XMPPGit.cmd
|
2012-11-06 04:52:35 +00:00
|
|
|
#endif
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.RemoteDaemon.cmd
|
2012-06-26 13:15:47 +00:00
|
|
|
#endif
|
2015-07-13 17:19:20 +00:00
|
|
|
, Command.Test.cmd testoptparser testrunner
|
2014-08-24 01:46:08 +00:00
|
|
|
#ifdef WITH_TESTSUITE
|
2014-10-14 18:20:10 +00:00
|
|
|
, Command.FuzzTest.cmd
|
2015-07-11 04:42:32 +00:00
|
|
|
, Command.TestRemote.cmd
|
2013-02-27 19:59:31 +00:00
|
|
|
#endif
|
2011-01-07 00:26:57 +00:00
|
|
|
]
|
|
|
|
|
2015-07-13 17:19:20 +00:00
|
|
|
run :: Parser TestOptions -> Maybe TestRunner -> [String] -> IO ()
|
|
|
|
run testoptparser testrunner args = do
|
2013-11-06 20:33:45 +00:00
|
|
|
#ifdef WITH_EKG
|
|
|
|
_ <- forkServer "localhost" 4242
|
|
|
|
#endif
|
2014-04-29 22:08:10 +00:00
|
|
|
go envmodes
|
|
|
|
where
|
2015-07-13 17:19:20 +00:00
|
|
|
go [] = dispatch True args
|
|
|
|
(cmds testoptparser testrunner)
|
|
|
|
gitAnnexGlobalOptions [] Git.CurrentRepo.get
|
2015-07-09 15:49:52 +00:00
|
|
|
"git-annex"
|
|
|
|
"manage files with git, without checking their contents in"
|
2014-04-29 22:08:10 +00:00
|
|
|
go ((v, a):rest) = maybe (go rest) a =<< getEnv v
|
|
|
|
envmodes =
|
2015-02-12 20:12:32 +00:00
|
|
|
[ (sshOptionsEnv, runSshOptions args)
|
2014-04-29 22:08:10 +00:00
|
|
|
, (sshAskPassEnv, runSshAskPass)
|
|
|
|
]
|