addurl: Support --json, particularly useful in --batch mode.

This commit is contained in:
Joey Hess 2016-01-13 14:25:30 -04:00
parent ecd0684bfc
commit 1d5b70db9c
Failed to extract signature
4 changed files with 10 additions and 1 deletions

View file

@ -41,7 +41,7 @@ import qualified Utility.Quvi as Quvi
#endif #endif
cmd :: Command cmd :: Command
cmd = notBareRepo $ withGlobalOptions [jobsOption] $ cmd = notBareRepo $ withGlobalOptions [jobsOption, jsonOption] $
command "addurl" SectionCommon "add urls to annex" command "addurl" SectionCommon "add urls to annex"
(paramRepeating paramUrl) (seek <$$> optParser) (paramRepeating paramUrl) (seek <$$> optParser)

1
debian/changelog vendored
View file

@ -34,6 +34,7 @@ git-annex (6.20151219) UNRELEASED; urgency=medium
displays in this situation. Fixed by treating files git thinks are displays in this situation. Fixed by treating files git thinks are
modified the same as typechanged files. modified the same as typechanged files.
* addurl: Added --batch and --with-files options. * addurl: Added --batch and --with-files options.
* addurl: Support --json, particularly useful in --batch mode.
* Debian: Adjust build dependencies for webapp, DAV. Now available on * Debian: Adjust build dependencies for webapp, DAV. Now available on
mips, mipsel, but temporarily removed armel since build is failing mips, mipsel, but temporarily removed armel since build is failing
there. there.

View file

@ -19,3 +19,6 @@ failed
"""]] """]]
[[!meta author=yoh]] [[!meta author=yoh]]
> I've made --json work for addurl; I feel that's the way to go for parsing
> its output. [[done]] --[[Joey]]

View file

@ -83,6 +83,11 @@ be used to get better filenames.
content if the file does not yet exist; the same as content if the file does not yet exist; the same as
`git annex addurl $url --file $file` `git annex addurl $url --file $file`
* `--json`
Enable JSON output. This is intended to be parsed by programs that use
git-annex. Each line of output is a JSON object.
# SEE ALSO # SEE ALSO
[[git-annex]](1) [[git-annex]](1)