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

@ -10,10 +10,9 @@ module Command.NumCopies where
import Command
import qualified Annex
import Annex.NumCopies
import Types.Messages
cmd :: Command
cmd = command "numcopies" SectionSetup
cmd = noMessages $ command "numcopies" SectionSetup
"configure desired number of copies"
paramNumber (withParams seek)
@ -35,7 +34,6 @@ start _ = giveup "Specify a single number."
startGet :: CommandStart
startGet = next $ next $ do
Annex.setOutput QuietOutput
v <- getGlobalNumCopies
case v of
Just n -> liftIO $ putStrLn $ show $ fromNumCopies n
@ -49,6 +47,7 @@ startGet = next $ next $ do
startSet :: Int -> CommandStart
startSet n = do
allowMessages
showStart "numcopies" (show n)
next $ next $ do
setGlobalNumCopies $ NumCopies n