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

@ -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`.