2015-02-06 19:12:42 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2015 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.GroupWanted where
|
|
|
|
|
|
|
|
import Common.Annex
|
|
|
|
import Command
|
|
|
|
import Logs.PreferredContent
|
2015-04-18 20:04:25 +00:00
|
|
|
import Command.Wanted (performGet, performSet)
|
2015-02-06 19:12:42 +00:00
|
|
|
|
|
|
|
cmd :: [Command]
|
|
|
|
cmd = [command "groupwanted" (paramPair paramGroup (paramOptional paramExpression)) seek
|
|
|
|
SectionSetup "get or set groupwanted expression"]
|
|
|
|
|
|
|
|
seek :: CommandSeek
|
|
|
|
seek = withWords start
|
|
|
|
|
|
|
|
start :: [String] -> CommandStart
|
2015-04-18 20:04:25 +00:00
|
|
|
start (g:[]) = next $ performGet groupPreferredContentMapRaw g
|
2015-02-06 19:12:42 +00:00
|
|
|
start (g:expr:[]) = do
|
|
|
|
showStart "groupwanted" g
|
2015-04-18 20:04:25 +00:00
|
|
|
next $ performSet groupPreferredContentSet expr g
|
2015-02-06 19:12:42 +00:00
|
|
|
start _ = error "Specify a group."
|