From owner-freebsd-arch@FreeBSD.ORG Thu Aug 14 16:41:01 2014 Return-Path: Delivered-To: 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 4865FA6E; Thu, 14 Aug 2014 16:41:01 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0189.outbound.protection.outlook.com [207.46.163.189]) (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 7CB2E2EE4; Thu, 14 Aug 2014 16:40:59 +0000 (UTC) Received: from BL2PR05CA0012.namprd05.prod.outlook.com (10.255.226.12) by DM2PR05MB735.namprd05.prod.outlook.com (10.141.178.24) with Microsoft SMTP Server (TLS) id 15.0.995.14; Thu, 14 Aug 2014 16:40:52 +0000 Received: from BN1AFFO11FD057.protection.gbl (2a01:111:f400:7c10::172) by BL2PR05CA0012.outlook.office365.com (2a01:111:e400:c04::12) with Microsoft SMTP Server (TLS) id 15.0.1010.18 via Frontend Transport; Thu, 14 Aug 2014 16:40:51 +0000 Received: from P-EMF01-SAC.jnpr.net (66.129.239.15) by BN1AFFO11FD057.mail.protection.outlook.com (10.58.53.72) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Thu, 14 Aug 2014 16:40:51 +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 09:40:50 -0700 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s7EGeDn46015; Thu, 14 Aug 2014 09:40:26 -0700 (PDT) (envelope-from phil@juniper.net) Received: from idle.juniper.net (localhost [127.0.0.1]) by idle.juniper.net (8.14.4/8.14.3) with ESMTP id s7EGe422096656; Thu, 14 Aug 2014 12:40:04 -0400 (EDT) (envelope-from phil@idle.juniper.net) Message-ID: <201408141640.s7EGe422096656@idle.juniper.net> 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> Date: Thu, 14 Aug 2014 12:40:04 -0400 From: Phil Shafer 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)(199003)(189002)(164054003)(81156004)(92566001)(21056001)(107046002)(99396002)(92726001)(85852003)(68736004)(4396001)(46102001)(6806004)(80022001)(86362001)(50986999)(74662001)(81542001)(81342001)(103666002)(76482001)(69596002)(74502001)(54356999)(84676001)(95666004)(64706001)(110136001)(53416004)(50466002)(20776003)(87936001)(83072002)(97736001)(47776003)(31966008)(79102001)(106466001)(48376002)(76506005)(77982001)(44976005)(85306004)(102836001)(83322001)(105596002); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR05MB735; H:P-EMF01-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: 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=phil@juniper.net; X-OriginatorOrg: juniper.net Cc: Marcel Moolenaar , John-Mark Gurney , "Simon J. Gerraty" , 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 16:41:01 -0000 Warner Losh writes: >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 causes the command to print nothing and >return 0 if it supports reporting, or anything else if it doesn't >(return 0 with output, or return non-zero with or without output). It's a chicken and egg problem. I can't call the command with the option until I know that command can handle the option without generating an error, a core file, or rebooting the box. Until I know what the command will do, I can't invoke it safely. There's also the issue of find an option that all commands are not using, given that I can't change options for existing commands. Thanks, Phil