aboutsummaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-02-19 14:03:23 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-02-19 14:12:15 -0400
commit0366c6eac698327ced9c63e241a9474a5c2a7e20 (patch)
tree6ca01bda2e500396154a4fa9b473fa3cc9bc193d /Types
parentef1a5a1f9b85de7261ac9a27bede3dedda88fb45 (diff)
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.
Diffstat (limited to 'Types')
-rw-r--r--Types/Messages.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Types/Messages.hs b/Types/Messages.hs
index 551531349..f259f3200 100644
--- a/Types/Messages.hs
+++ b/Types/Messages.hs
@@ -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)