[libvirt] [PATCH 1/3] virt-xml-validate: add --help/--version option

Eric Blake eblake at redhat.com
Tue Aug 20 02:20:59 UTC 2013


On 08/19/2013 07:51 PM, Guan Nan Ren wrote:
>> This treats '-' as an unrecognized option (which is a bit misleading,
>> since in POSIX terminology a lone - is NOT an option but an argument).
>> It also raises the question - should we allow for an XMLFILE of '-' to
>> mean reading from stdin, the way POSIX recommends?  That is, should we
>> support:
>> 
>> virsh dumpxml $dom | virt-xml-validate -
> 
> 
> grep use "grep -f -" to donate the standard input. As written in its manpage
>  -f is specified by POSIX. If we use -f, the single hyphen can be used
> as a filename. But as you said in the follow, user can prefix the filename
> with a path - ./-, or /home/Tim/-, so it is still fine in this case.

Actually, 'grep -f - file' and 'grep pattern -' are two quite different
uses of '-' meaning stdin (one treats stdin as the file containing the
pattern, the other treats stdin as the file to search).  But yes, the
point is that since POSIX requires '-' to mean stdin when possible,
people are used to that idiom, and used to using ./- when wanting to
refer to a file literally named -.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130819/e6d31523/attachment-0001.sig>


More information about the libvir-list mailing list