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