make query commands not output extraneous messages

config group groupwanted numcopies schedule wanted required:  Avoid
displaying extraneous messages about repository auto-init, git-annex branch
merging, etc, when being used to get information.
This commit is contained in:
Joey Hess 2017-02-16 13:24:16 -04:00
parent baa2ab2c7d
commit d0651bb567
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
10 changed files with 51 additions and 15 deletions

View file

@ -15,7 +15,7 @@ import Types.Group
import qualified Data.Set as S
cmd :: Command
cmd = command "group" SectionSetup "add a repository to a group"
cmd = noMessages $ command "group" SectionSetup "add a repository to a group"
(paramPair paramRemote paramDesc) (withParams seek)
seek :: CmdParams -> CommandSeek
@ -23,12 +23,13 @@ seek = withWords start
start :: [String] -> CommandStart
start (name:g:[]) = do
allowMessages
showStart "group" name
u <- Remote.nameToUUID name
next $ setGroup u g
start (name:[]) = do
u <- Remote.nameToUUID name
showRaw . unwords . S.toList =<< lookupGroups u
liftIO . putStrLn . unwords . S.toList =<< lookupGroups u
stop
start _ = giveup "Specify a repository and a group."