Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2014 12:40:04 -0400
From:      Phil Shafer <phil@juniper.net>
To:        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:  <201408141640.s7EGe422096656@idle.juniper.net>
In-Reply-To: <94A47A7D-89C9-4504-B669-2A5EDA80373B@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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