summaryrefslogtreecommitdiff
path: root/CmdLine
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 /CmdLine
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 'CmdLine')
-rw-r--r--CmdLine/GitAnnex/Options.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index d762f6a00..51c55b056 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -295,18 +295,26 @@ combiningOptions =
shortopt o h = globalFlag (Limit.addToken [o]) ( short o <> help h <> hidden )
jsonOption :: GlobalOption
-jsonOption = globalFlag (Annex.setOutput (JSONOutput False))
+jsonOption = globalFlag (Annex.setOutput (JSONOutput jsonoptions))
( long "json" <> short 'j'
<> help "enable JSON output"
<> hidden
)
+ where
+ jsonoptions = JSONOptions
+ { jsonProgress = False
+ }
jsonProgressOption :: GlobalOption
-jsonProgressOption = globalFlag (Annex.setOutput (JSONOutput True))
+jsonProgressOption = globalFlag (Annex.setOutput (JSONOutput jsonoptions))
( long "json-progress"
<> help "include progress in JSON output"
<> hidden
)
+ where
+ jsonoptions = JSONOptions
+ { jsonProgress = True
+ }
-- Note that a command that adds this option should wrap its seek
-- action in `allowConcurrentOutput`.