incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <>
Subject Re: Appending "\n" and pretty printing output from the command line using curl (with a smidge of python)
Date Thu, 21 Aug 2008 22:29:46 GMT

On Aug 22, 2008, at 00:17, Christopher Lenz wrote:

> On 21.08.2008, at 03:10, Noah Slater wrote:
>> On Wed, Aug 20, 2008 at 01:04:49PM -0500, Jason Huggins wrote:
>>> I was thinking about creating a patch to add a "\n" at the end of
>>> every request, but I figured that would be a request of last resort.
>> I did this very patch about 6 months ago but it was rejected and I  
>> can't quite
>> remember why. Now that we're at the ASF I would like to call an  
>> informal vote.
>> Fellow committers, what say ye to adding a trailing \n to JSON  
>> output?
> I think when you first brought this up, the patch would add a  
> trailing newline to all responses, which would potentially corrupt  
> binary responses such as for attachments.
> If this is done for JSON responses only, I don't see any problems  
> with adding a trailing newline.
> [Not in direct response to this mail, but rather others on this  
> thread:] Pretty-printing OTOH... I don't think it's worth it. This  
> stuff isn't really intended for direct consumption by humans, and if  
> you need prettified output, just post-process it with one of the  
> bazillion available libs. Not something CouchDB should concern  
> itself with.

I see the benefits, but:

jan@macnolia ~> curl -X GET http://localhost:5984/
{"couchdb":"Welcome","version":"0.8.0-incubating"}jan@macnolia ~>
jan@macnolia ~>
jan@macnolia ~> ./ -X GET http://localhost:5984/
jan@macnolia ~> cat
curl $@
echo ""jan@macnolia ~>

So this should be done on the client, in my opinion. Nothing stops
us from shipping a newlineadding and prettyprinting CouchDB client,
but i don't think that should be in the server.


View raw message