diff --git a/CHANGELOG b/CHANGELOG index ecd1b86f9d..197cee8499 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -38,7 +38,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium * initremote: Avoid creating a remote that is not encrypted when gpg is broken. * Support --json and --json-error-messages in more commands - (addunused, dead, describe, dropunused, expire, fix, log, migrate, + (addunused, dead, describe, dropunused, expire, fix, init, log, migrate, rekey, rmurl, semitrust, setpresentkey, trust, unannex, undo, untrust, unused) * log: When --raw-date is used, display only seconds from the epoch, as diff --git a/Command/Init.hs b/Command/Init.hs index fa129b8091..2b7bbeb8a1 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -19,7 +19,7 @@ import Control.Monad.Fail as Fail (MonadFail(..)) import qualified Data.Map as M cmd :: Command -cmd = dontCheck repoExists $ +cmd = dontCheck repoExists $ withAnnexOptions [jsonOptions] $ command "init" SectionSetup "initialize git-annex" paramDesc (seek <$$> optParser) diff --git a/doc/git-annex-init.mdwn b/doc/git-annex-init.mdwn index 09d5e94af1..aa0e418639 100644 --- a/doc/git-annex-init.mdwn +++ b/doc/git-annex-init.mdwn @@ -57,6 +57,16 @@ to the user who tries to run git-annex init. Do not enable special remotes that were configured with autoenable=true. +* `--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 diff --git a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn index 1f3230ee76..5e90653e51 100644 --- a/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn +++ b/doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn @@ -32,6 +32,7 @@ These commands have been updated to support --json: * git-annex-dead * git-annex-describe * git-annex-unused +* git-annex-init Provisional list of commands that don't support --json and maybe should: @@ -39,8 +40,6 @@ Provisional list of commands that don't support --json and maybe should: * git-annex-configremote * git-annex-enableremote -* git-annex-importfeed -* git-annex-init * git-annex-initremote * git-annex-merge * git-annex-reinit @@ -57,6 +56,10 @@ These commands could support json, but I punted: * git-annex-version (--raw already exists, and the output is fairly machine parseable already. It would be possible to jsonize the output to make it possibly more machine parseable. But I'm doubtful that would be useful. +* git-annex-importfeed (implemented w/o using usual command actions, + which makes warning messages not get put in any particular json record. + Same problem would also need to be fixed for [[doc/todo/importfeed_parallell]] + btw.) These commands have been reviewed and should not support json: