Date: Thu, 14 Aug 2014 17:44:34 -0700 From: Alfred Perlstein <bright@mu.org> To: Phil Shafer <phil@juniper.net>, Warner Losh <imp@bsdimp.com> Cc: Marcel Moolenaar <marcel@freebsd.org>, John-Mark Gurney <jmg@funkthat.com>, "Simon J. Gerraty" <sjg@juniper.net>, 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: <53ED57F2.5020808@mu.org> In-Reply-To: <201408141640.s7EGe422096656@idle.juniper.net> References: <201408141640.s7EGe422096656@idle.juniper.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 8/14/14 9:40 AM, Phil Shafer wrote: > 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. > > I don't understand the need to query these programs for support of the option. Can you explain in more detail? -Alfred
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53ED57F2.5020808>