While I don't doubt that different output formats are useful - see the Juniper fluff at http://juniper.github.io/libxo/libxo-manual.html -- the mechanics involved in getting there are not obvious, convoluted, intrusive and difficult to get right -- see the manual page at https://www.freebsd.org/cgi/man.cgi?query=libxo&apropos=0&sektion=3&manpath=FreeBSD+11-current&format=html
I keep thinking "there must be a better way", mainly because we don't need xml (again, if the answer is xml, it's a pretty stupid question), and converting between json and human format is done better by other libraries. On 27 December 2016 at 10:01, Christos Zoulas <[email protected]> wrote: > In article <CAHwRYJmOTZHK6R=nc0czT2Uy=w5CvmycZqcVdUyVHNsU5UPATQ@mail. > gmail.com>, > Abhinav Upadhyay <[email protected]> wrote: > >On Tue, Dec 27, 2016 at 9:25 PM, Christos Zoulas <[email protected]> > wrote: > >> In article > ><CAHwRYJnCSvd4q7+O2nAeGjXT8Gm=6wzxjlfi7cqx4xaibpp...@mail.gmail.com>, > >> Abhinav Upadhyay <[email protected]> wrote: > >>>On Tue, Dec 27, 2016 at 1:44 AM, Robert Elz <[email protected]> wrote: > >>>> The last time I saw this discussed, I think that the conclusion was > >>>> that where posix specifies a space, other wording permits any number > >>>> of spaces. That means that we comply. > >>> > >>>Yes, that makes sense for the %7lu, but what about the leading space > >>>in the first column? > >> > >> We could get rid of it, but if we are going to touch wc, we could go > >> the FreeBSD way, add libxo etc... But that opens a bigger discussion... > > > >Yes, I had a look at FreeBSD's wc(1), they use libxo. > > > >libxo looks nice actually and seems very useful. For example, > >apropos(1) has an API to generate HTML output. For man-k.org I had to > >create a similar API to generate JSON output (not committed). > >Something like libxo would make this very easy :) > > Well, if people think that we should bring in libxo, let's vote. I vote > yes :-) > > christos > >
