upgrade: Support --json and --json-error-messages and --json-progress

Seems unlikely to be very useful, but trivial.

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
Joey Hess 2023-05-10 12:41:43 -04:00
parent c98fb0b637
commit 8d8e044458
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 14 additions and 2 deletions

View file

@ -40,7 +40,8 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
* Support --json and --json-error-messages in more commands
(addunused, dead, describe, dropunused, expire, fix, importfeed, init,
log, merge, migrate, reinit, reinject, rekey, renameremote, rmurl,
semitrust, setpresentkey, trust, unannex, undo, untrust, unused)
semitrust, setpresentkey, trust, unannex, undo, untrust, unused,
upgrade)
* log: When --raw-date is used, display only seconds from the epoch, as
documented, omitting a trailing "s" that was included in the output
before.

View file

@ -20,6 +20,7 @@ cmd = dontCheck
repoExists $
-- avoid upgrading repo out from under daemon
noDaemonRunning $
withAnnexOptions [jsonOptions] $
command "upgrade" SectionMaintenance "upgrade repository"
paramNothing (seek <$$> optParser)

View file

@ -31,6 +31,16 @@ allow archives to be taken offline for years and later used.
Only do whatever automatic upgrade can be done, don't necessarily
upgrade to the latest version. This is used internally by git-annex.
* `--json`
Enable JSON output. This is intended to be parsed by programs that use
git-annex.
* `--json-error-messages`
Messages that would normally be output to standard error are included in
the JSON instead.
* Also the [[git-annex-common-options]](1) can be used.
# SEE ALSO

View file

@ -38,13 +38,13 @@ These commands have been updated to support --json:
* git-annex-renameremote
* git-annex-importfeed
* git-annex-merge
* git-annex-upgrade
Provisional list of commands that don't support --json and maybe should:
* git-annex-configremote
* git-annex-enableremote
* git-annex-initremote
* git-annex-upgrade
These commands could support json, but I punted: