XML Output: libxo - provide single API to output TXT, XML, JSON and HTML

Phil Shafer phil at juniper.net
Thu Aug 14 16:41:01 UTC 2014


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


More information about the freebsd-arch mailing list