refactor
This commit is contained in:
parent
73ed2f8ec1
commit
ae1e9f921b
4 changed files with 27 additions and 69 deletions
|
@ -7,34 +7,13 @@
|
|||
|
||||
module Command.Dead where
|
||||
|
||||
import Common.Annex
|
||||
import Command
|
||||
import qualified Remote
|
||||
import Logs.Trust
|
||||
import Logs.Group
|
||||
|
||||
import qualified Data.Set as S
|
||||
import Types.TrustLevel
|
||||
import Command.Trust (trustCommand)
|
||||
|
||||
def :: [Command]
|
||||
def = [command "dead" (paramRepeating paramRemote) seek
|
||||
SectionSetup "hide a lost repository"]
|
||||
|
||||
seek :: CommandSeek
|
||||
seek = withWords start
|
||||
|
||||
start :: [String] -> CommandStart
|
||||
start ws = do
|
||||
let name = unwords ws
|
||||
showStart "dead" name
|
||||
u <- Remote.nameToUUID name
|
||||
next $ perform u
|
||||
|
||||
perform :: UUID -> CommandPerform
|
||||
perform uuid = do
|
||||
markDead uuid
|
||||
next $ return True
|
||||
|
||||
markDead :: UUID -> Annex ()
|
||||
markDead uuid = do
|
||||
trustSet uuid DeadTrusted
|
||||
groupSet uuid S.empty
|
||||
seek = trustCommand "dead" DeadTrusted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue