XML Output: libxo - provide single API to output TXT, XML, JSON and HTML

John Baldwin jhb at freebsd.org
Thu Aug 14 18:31:30 UTC 2014


On Thursday, August 14, 2014 1:16:47 pm Simon J. Gerraty wrote:
> 
> >My question for people advocating this method: Why not require all =
> >commands
> >that generate this kind of output to support a standard command line =
> >option
> 
> That's basically what we did in Junos, except the -X option currently
> just means output XML.
> That worked fine for the limited number of bsd apps that we frobbed,
> but pretty hard to assert that it could be expanded to all apps.
> 
> Thus I think Phil was looking for a more generic solution.
> 
> I think your suggestion could work fine.
> Since (I think) Phil mentioned libxo being able to check options,
> it should be ok to run an app with an option like:
> 
> --libxo-is-supported
> 
> that's guaranteed to not conflict with any existing option.
> Any app that hasn't been converted will choke and die, any that has will 
> exit happy.
> 
> You could add other --libxo-* options to control output - if environment
> variables are not considered desirable

I vote for this.

-- 
John Baldwin


More information about the freebsd-arch mailing list