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 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
|
2017-02-16 17:24:16 +00:00
|
|
|
cmd = noMessages $ command "groupwanted" SectionSetup
|
2015-07-08 19:08:02 +00:00
|
|
|
"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
|
2017-02-16 17:24:16 +00:00
|
|
|
allowMessages
|
2015-02-06 19:12:42 +00:00
|
|
|
showStart "groupwanted" g
|
2015-04-18 20:04:25 +00:00
|
|
|
next $ performSet groupPreferredContentSet expr g
|
2016-11-16 01:29:54 +00:00
|
|
|
start _ = giveup "Specify a group."
|