Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2014 10:16:47 -0700
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Marcel Moolenaar <marcel@freebsd.org>, Phil Shafer <phil@juniper.net>, John-Mark Gurney <jmg@funkthat.com>, arch@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-arch <freebsd-arch@freebsd.org>, Konstantin Belousov <kostikbel@gmail.com>
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <20140814171647.2241D580A2@chaos.jnpr.net>
In-Reply-To: <94A47A7D-89C9-4504-B669-2A5EDA80373B@bsdimp.com>
References:  <20140814052648.GM2737@kib.kiev.ua> <201408140606.s7E66XXA091972@idle.juniper.net> <20140814085257.GN2737@kib.kiev.ua> <201408140847.00573.jhb@freebsd.org> <94A47A7D-89C9-4504-B669-2A5EDA80373B@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140814171647.2241D580A2>