[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v4 5/8] screenshot: Expose the new API in virsh

On 05/13/2011 03:16 AM, Daniel P. Berrange wrote:
> On Thu, May 12, 2011 at 06:29:12PM +0200, Michal Privoznik wrote:
>> +static const vshCmdOptDef opts_screenshot[] = {
>> +    {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
>> +    {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to store the screenshot")},
>> +    {"screen", VSH_OT_INT, 0, N_("ID of a screen to take screenshot of")},
>> +    {NULL, 0, 0, NULL}
>> +};
>> +

> I think it would be better if 'screenID' was a flag instead of a
> positional parameter, eg
>       screenshot --screen 1 myguest imagefile.png

But virsh _already_ handles all named arguments in any order.  That is,

screenshot --screen 1 myguest imagefile.png
screenshot myguest imagefile.png 1

are identical, at least with the above opts_screenshot (thanks to commit

> That would then allow us to make the filename optional too. eg
>    screenshot --screen 1 myguest

Optional filename, however, _does_ make sense, which is not covered in
the above opts_screenshot.

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]