2011-03-03 21:21:00 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2011 Joey Hess <id@joeyh.name>
|
2011-03-03 21:21:00 +00:00
|
|
|
-
|
2019-03-13 19:48:14 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2011-03-03 21:21:00 +00:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Describe where
|
|
|
|
|
|
|
|
import Command
|
2011-03-27 20:55:43 +00:00
|
|
|
import qualified Remote
|
2011-10-15 20:21:08 +00:00
|
|
|
import Logs.UUID
|
2011-03-03 21:21:00 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
2015-07-08 19:08:02 +00:00
|
|
|
cmd = command "describe" SectionSetup
|
|
|
|
"change description of a repository"
|
|
|
|
(paramPair paramRemote paramDesc)
|
|
|
|
(withParams seek)
|
2011-03-03 21:21:00 +00:00
|
|
|
|
2015-07-08 19:08:02 +00:00
|
|
|
seek :: CmdParams -> CommandSeek
|
2018-10-01 18:12:06 +00:00
|
|
|
seek = withWords (commandAction . start)
|
2011-03-03 21:21:00 +00:00
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: [String] -> CommandStart
|
2011-10-31 20:46:51 +00:00
|
|
|
start (name:description) = do
|
2017-11-28 18:40:26 +00:00
|
|
|
showStart' "describe" (Just name)
|
2011-03-27 20:55:43 +00:00
|
|
|
u <- Remote.nameToUUID name
|
2011-10-31 20:46:51 +00:00
|
|
|
next $ perform u $ unwords description
|
2016-11-16 01:29:54 +00:00
|
|
|
start _ = giveup "Specify a repository and a description."
|
2011-03-03 21:21:00 +00:00
|
|
|
|
2011-03-27 20:55:43 +00:00
|
|
|
perform :: UUID -> String -> CommandPerform
|
|
|
|
perform u description = do
|
2019-01-01 19:39:45 +00:00
|
|
|
describeUUID u (toUUIDDesc description)
|
2011-06-22 20:03:26 +00:00
|
|
|
next $ return True
|