<div dir="ltr">Hi, thanks for your response.<br><div><br>On 24 March 2017 at 09:07, Aleksander Morgado <span dir="ltr"><<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<div><div class="gmail-h5"><br>
</div></div>But I didn't think of tab-separated outputs, more maybe something like this:<br>
<br>
ipv6.address=2a01:4c8:1b:eb13:<wbr>2dbf:b045:8a94:88fa/64<br>
ipv6.gateway=2a01:4c8:1b:eb13:<wbr>40dc:ba5f:4d43:d4c<br>
ipv6.dns0=2a01:4c8:f000:1::1<br>
ipv6.dns1= 2a01:4c8:f000:1::2<br>
mtu=1500<br></blockquote><div><br></div><div>That seems like a simple-enough change (and makes it much easier to do a hacky parser if you don't mind using the `eval` shell builtin).  I guess you would want the right hand side to be quoted if it contains spaces or shell special characters?  I don't know offhand if any of the programs is likely to produce output with special characters in it. so I may be worrying prematurely there.<br></div><div><br>>I've seen other attempts to do this using e.g.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
JSON formatted output, but I never liked that for integration of CLIs<br>
in shell scripts.<br></blockquote><div><br></div><div>Yes, I considered and rejected JSON (and its brother YAML) for the same reason.  Shell-friendliness implies something line-based, imo<br></div> <br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
And also, there has to be a way of querying which would be the<br>
possible output fields that a command may generate, so that when<br>
you're developing based on the CLI outputs, you can know in advance<br>
which fields you may receive as output without needing to look at the<br>
source code. Something like:<br>
<br>
$ mbimcli --query-ip-configuration --machine-readable-help<br></blockquote><div><br></div><div>I was going to go a bit more low-ceremony here, and embed the metadata fields in with the data.  So you might get something like<br><br></div><div>_fields=ipv6,ipv4<br></div><div>ipv6._fields=address,gateway,dns,mtu<br></div><div>ipv6.address=2a01:4c8:1b:eb13:<wbr>2dbf:b045:8a94:88fa/64<br>
ipv6.gateway=2a01:4c8:1b:eb13:<wbr>40dc:ba5f:4d43:d4c<br>
ipv6.dns=2a01:4c8:f000:1::1<br>
ipv6.dns= 2a01:4c8:f000:1::2<br>
ipv6.mtu=1500<br><div>ipv4._fields=address<br></div><div>ipv4.address=10.43.0.1<br></div></div><div><br></div><div>Would that work for your use case?<br></div><br>> Maybe mbimcli is the best candidate to start adding support for this,<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
as I think it's the simplest of the CLIs for now.<br></blockquote><div><br></div><div>mbimcli is certainly the most relevant for me as it's the only one I can test with actual hardware ;-)<br></div><div><br><br></div><div>-dan<br><br></div></div></div></div></div>