Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 2014 23:19:39 -0400
From:      "Garance A Drosehn" <drosih@rpi.edu>
To:        "Alfred Perlstein" <bright@mu.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <448BB170-6DDC-442B-A5C5-973EC35FF7B9@rpi.edu>
In-Reply-To: <53D85495.4050408@mu.org>
References:  <20140725044921.9F0D3580A2@chaos.jnpr.net> <CAETOPp13H7kyLy-1VJRDOsDbOh8A1MWZDxw1xHUBsxTRtMfc7g@mail.gmail.com> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> <CAETOPp3hJB8Gj%2BPMj3N951krnNqCYiAOY-cPHxMCBy1CQXWJaQ@mail.gmail.com> <A1E63A7A-BB38-4CC3-B5EC-B251BE990572@mail.turbofuzz.com> <20140729230345.31E9B580A2@chaos.jnpr.net> <53D85495.4050408@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29 Jul 2014, at 22:12, Alfred Perlstein wrote:
>
> How many utils are converted over at this point?
>
> Have you seen the GSOC project which aims to do this as well?
> "machine readable output from userland utilities" -> =

> https://www.google-melange.com/gsoc/project/details/google/gsoc2014/zar=
ko_korchev/5676830073815040
>
> -Alfred

FWIW, I've been experimenting a bit with something like this for 'lpq'
output, although I'm doing it in a script outside of 'lpq'.  Which is
to say, I haven't tried modifying the code of lpq itself because that's
a real mess to modify due to the way lpq builds each line that it =

prints.

The above URL is just a pointer to the project listing at gsoc.  The =

wiki
page might also be more informative:

https://wiki.freebsd.org/SummerOfCode2014/MachineReadableFromUserlandUtil=
s

although I must admit I don't know how to check what source changes have
been made so far by starting that that wiki entry.

One question that comes up is how to organize the data in the output the
command creates.  For instance, my experiment is just trying to mimic a
rather inefficient process was implemented by some student consultants,
and I wouldn't have organized the JSON object the way they did.  I =

wouldn't
have picked the same names for keys, for instance.  But there are some =

more
complicated issues which come up, due to the fact that one 'lpq' command
can be showing data from multiple processes which are running on =

multiple
hosts, and 'lpq' on the current host can't depend on getting JSON output
from the other hosts or processes that it gets information from.

Given the way lpq's source is organized, I'm also thinking that maybe =

it'd be
better to do this as a separate command, maybe something like =

'lpserialize'.

I personally don't expect unix commands to output HTML, and I find XML a =

bit
unwieldy to work with.  But in my own bikeshed I'm interested in formats =

of
json, yaml, and edn (from the world of Clojure).

In any case, I am interested to see how the GSOC project works out, or
whatever happens with this libxo project.

-- =

Garance Alistair Drosehn                =3D     drosih@rpi.edu
Senior Systems Programmer               or   gad@FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?448BB170-6DDC-442B-A5C5-973EC35FF7B9>