fix --json-progress --json to be same as --json --json-progress

Fix behavior of --json-progress followed by --json, in which
the latter option disabled the former.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-02-19 14:03:23 -04:00
parent 8ccfbd14d0
commit fa65f1d240
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 35 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{- git-annex Messages data types
-
- Copyright 2012-2017 Joey Hess <id@joeyh.name>
- Copyright 2012-2018 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@ -16,9 +16,20 @@ import Control.Concurrent
import System.Console.Regions (ConsoleRegion)
#endif
data OutputType = NormalOutput | QuietOutput | JSONOutput Bool
data OutputType = NormalOutput | QuietOutput | JSONOutput JSONOptions
deriving (Show)
data JSONOptions = JSONOptions
{ jsonProgress :: Bool
}
deriving (Show)
adjustOutputType :: OutputType -> OutputType -> OutputType
adjustOutputType (JSONOutput old) (JSONOutput new) = JSONOutput $ JSONOptions
{ jsonProgress = jsonProgress old || jsonProgress new
}
adjustOutputType _old new = new
data SideActionBlock = NoBlock | StartBlock | InBlock
deriving (Eq)