From d74d2d5d91ef648aa02dc0d1852fdf13dbf72b8c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Mar 2025 15:51:43 -0400 Subject: [PATCH] --json for addcomputed and recompute Not very useful, but it does work. --- Command/AddComputed.hs | 2 +- Command/Recompute.hs | 2 +- doc/git-annex-addcomputed.mdwn | 5 +++++ doc/git-annex-recompute.mdwn | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Command/AddComputed.hs b/Command/AddComputed.hs index 2c389ef53a..4c1b68e111 100644 --- a/Command/AddComputed.hs +++ b/Command/AddComputed.hs @@ -36,7 +36,7 @@ import qualified Data.Map as M import Data.Time.Clock cmd :: Command -cmd = notBareRepo $ withAnnexOptions [backendOption] $ +cmd = notBareRepo $ withAnnexOptions [backendOption, jsonOptions] $ command "addcomputed" SectionCommon "add computed files to annex" (paramRepeating paramExpression) (seek <$$> optParser) diff --git a/Command/Recompute.hs b/Command/Recompute.hs index df701fb852..5d9f93fde1 100644 --- a/Command/Recompute.hs +++ b/Command/Recompute.hs @@ -29,7 +29,7 @@ import qualified Data.Map as M import System.PosixCompat.Files (isSymbolicLink) cmd :: Command -cmd = notBareRepo $ +cmd = notBareRepo $ withAnnexOptions [jsonOptions] $ command "recompute" SectionCommon "recompute computed files" paramPaths (seek <$$> optParser) diff --git a/doc/git-annex-addcomputed.mdwn b/doc/git-annex-addcomputed.mdwn index faff1d96b6..7b2ca0b86a 100644 --- a/doc/git-annex-addcomputed.mdwn +++ b/doc/git-annex-addcomputed.mdwn @@ -86,6 +86,11 @@ the parameters provided to `git-annex addcomputed`. Specifies which key-value backend to use. +* `--json` + + Enable JSON output. This is intended to be parsed by programs that use + git-annex. Each line of output is a JSON object. + * Also the [[git-annex-common-options]](1) can be used. # SEE ALSO diff --git a/doc/git-annex-recompute.mdwn b/doc/git-annex-recompute.mdwn index f10125827c..daf403471f 100644 --- a/doc/git-annex-recompute.mdwn +++ b/doc/git-annex-recompute.mdwn @@ -48,6 +48,11 @@ updated with the new content. The updated file is staged in git. This is the default when the compute remote indicates that it produces reproducible output. +* `--json` + + Enable JSON output. This is intended to be parsed by programs that use + git-annex. Each line of output is a JSON object. + * matching options The [[git-annex-matching-options]](1) can be used to control what -- 2.30.2