I’m trying to convince the
lxc binary (version 3.4) to output data in a fashion that can be easily worked with from a shell script. Alas, I notice that the really useful flag
--format csv, for example, is not universally usable.
For example it’s possible to do
lxc image list --format csv -c f, but not many commands accept a similar flag. For example
lxc --format csv profile list results in
Error: unknown flag: --format, while
lxc profile list shows a “table” using ASCII art.
lxc profile device list <profilename> does not accept the
--format flag either. Not too bad, because it seems to print a plain list of device names, one per line.
However, in the last case I am unsure if I can rely on that or if the output might arbitrarily be changed to the fancier “table” appearance in newer versions.
So in addition to the question from the subject line on how to get
lxc to output easily parseable data, I’d like to ask what the policy is regarding the “stability” of the output format, as that’s effectively an interface into the software (and lends itself to use inside scripts).
Thanks and best regards.