From owner-freebsd-arch@FreeBSD.ORG Thu Aug 14 17:17:16 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3DE7895; Thu, 14 Aug 2014 17:17:15 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (dns-bn1lp0143.outbound.protection.outlook.com [207.46.163.143]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB6E722D9; Thu, 14 Aug 2014 17:17:14 +0000 (UTC) Received: from BLUPR05MB724.namprd05.prod.outlook.com (10.141.207.154) by BLUPR05MB628.namprd05.prod.outlook.com (10.141.204.156) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Thu, 14 Aug 2014 17:17:06 +0000 Received: from BN1PR05CA010.namprd05.prod.outlook.com (10.255.197.30) by BLUPR05MB724.namprd05.prod.outlook.com (10.141.207.154) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Thu, 14 Aug 2014 17:17:05 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::159) by BN1PR05CA010.outlook.office365.com (2a01:111:e400:400::30) with Microsoft SMTP Server (TLS) id 15.0.1005.10 via Frontend Transport; Thu, 14 Aug 2014 17:17:04 +0000 Received: from P-EMF01-SAC.jnpr.net (66.129.239.15) by BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Thu, 14 Aug 2014 17:17:04 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF01-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Thu, 14 Aug 2014 10:16:52 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s7EHGln70544; Thu, 14 Aug 2014 10:16:48 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 2241D580A2; Thu, 14 Aug 2014 10:16:47 -0700 (PDT) To: Warner Losh Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML 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> Comments: In-reply-to: Warner Losh message dated "Thu, 14 Aug 2014 10:13:26 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 14 Aug 2014 10:16:47 -0700 Message-ID: <20140814171647.2241D580A2@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.15; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199003)(99396002)(31966008)(105596002)(79102001)(80022001)(74502001)(85852003)(4396001)(77982001)(81342001)(90896003)(50226001)(86362001)(50466002)(93886004)(62966002)(87936001)(46102001)(69596002)(33656002)(81156004)(95666004)(85306004)(104166001)(76506005)(48376002)(92566001)(64706001)(68736004)(83322001)(102836001)(21056001)(97736001)(101356003)(76482001)(47776003)(76176999)(87286001)(89996001)(70486001)(93916002)(57986006)(74662001)(88136002)(110136001)(102176002)(77156001)(84676001)(93546004)(83072002)(20776003)(50986999)(106466001)(44976005)(81542001)(6806004)(107046002)(92726001)(42262002); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR05MB724; H:P-EMF01-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:;UriScan:; X-Forefront-PRVS: 03030B9493 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.15) smtp.mailfrom=sjg@juniper.net; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:; X-OriginatorOrg: juniper.net 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 17:17:16 -0000 >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