From owner-freebsd-arch@FreeBSD.ORG Thu Aug 14 18:31:30 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABD9AF2A; Thu, 14 Aug 2014 18:31:30 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC172CBB; Thu, 14 Aug 2014 18:31:30 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 79C70B987; Thu, 14 Aug 2014 14:31:28 -0400 (EDT) From: John Baldwin To: "Simon J. Gerraty" Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML Date: Thu, 14 Aug 2014 14:22:08 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <20140814052648.GM2737@kib.kiev.ua> <94A47A7D-89C9-4504-B669-2A5EDA80373B@bsdimp.com> <20140814171647.2241D580A2@chaos.jnpr.net> In-Reply-To: <20140814171647.2241D580A2@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201408141422.08265.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Aug 2014 14:31:28 -0400 (EDT) Cc: Marcel Moolenaar , Phil Shafer , John-Mark Gurney , arch@freebsd.org, Poul-Henning Kamp , freebsd-arch , Konstantin Belousov X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:31:30 -0000 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