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

@ -11,7 +11,8 @@ import Command
import Logs.Config
cmd :: Command
cmd = command "config" SectionSetup "configuration stored in git-annex branch"
cmd = noMessages $ command "config" SectionSetup
"configuration stored in git-annex branch"
paramNothing (seek <$$> optParser)
data Action
@ -47,11 +48,13 @@ optParser _ = setconfig <|> getconfig <|> unsetconfig
seek :: Action -> CommandSeek
seek (SetConfig name val) = commandAction $ do
allowMessages
showStart name val
next $ next $ do
setGlobalConfig name val
return True
seek (UnsetConfig name) = commandAction $ do
allowMessages
showStart name "unset"
next $ next $ do
unsetGlobalConfig name