mpack wrote: ↑30. Jun 2023, 15:46
The latter is a command (verb), not a reporting function.
Sorry, but you're wrong here. Both commands give more or less the same information, just for different states of the VM, so the request is sensible IMHO.
Oh, I see. One shows info for the VM, the other shows info for a snapshot. I mostly stopped reading after "VBoxManage snapshot" since I considered that a verb.
So yes, I agree it's a sensible request. In fact I'd be kinda surprised if the same code wasn't responsible for rendering the same info in both cases. It seems so obvious that you'd just pass a pointer to an info struct.
However, the difference between regular output and machinereadable output do not look that different to me from a script-driven parsing standpoint. Machinereadable would be good for both regular and snapshot showvminfo's, but regular output is quite usable by itself.
In machinereadable, you'd split each line output of the command on the =, and the first part is the data type, the second is the data.
In "humanreadable", you'd split on the :, the first part is the data type. Trim the second part of leading spaces to get the data.
I don't see anything in either output that wouldn't be beyond typical VBscript string manipulation. Note that machinereadable still requires string manipulation, unless the programming language has a datatype=data reader built-in. And if VBscript can do it, it's likely any programming language could do it. (DOS batch files might be a little harder to do it in, but I suspect it could still be done on either output.)