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
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
2015-07-08 19:08:02 +00:00
|
|
|
cmd = command "groupwanted" SectionSetup
|
|
|
|
"get or set groupwanted expression"
|
|
|
|
(paramPair paramGroup (paramOptional paramExpression))
|
|
|
|
(withParams seek)
|
2015-02-06 19:12:42 +00:00
|
|
|
|
2015-07-08 19:08:02 +00:00
|
|
|
seek :: CmdParams -> CommandSeek
|
2015-02-06 19:12:42 +00:00
|
|
|
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."
|