This is a differential for the Bugzilla report https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215008.
The diff is a squash of two patches on jls(8) and its man page, aiming to improve the output style when using --libxo output.
I squashed the patches because I cannot figure out how to present a patch series in phabricator.
Below the commit messages.
Separate libxo leaf-lists for IPv4 and IPv6 addresses.
'jls -v --libxo text' does not change its output with this commit.
'jls -v --libxo json' and 'jls -v --libxo xml' however do:
{ {
"__version": "1", "__version": "1",
"jail-information": { "jail-information": {
"jail": [ "jail": [
{ {
"jid": 166, "jid": 166,
"hostname": "foo.com", "hostname": "foo.com",
"path": "/var/jail/foo", "path": "/var/jail/foo",
"name": "foo", "name": "foo",
"state": "ACTIVE", "state": "ACTIVE",
"cpusetid": 2, "cpusetid": 2,
"ipv4_addrs": [ "ipv4_addrs": [
"10.1.1.1", "10.1.1.1",
"10.1.1.2", "10.1.1.2",
"10.1.1.3", | "10.1.1.3"
> ],
> "ipv6_addrs": [
"fe80::1000:1", "fe80::1000:1",
"fe80::1000:2" "fe80::1000:2"
] ]
} }
] ]
} }
} }Print ip4.addr and ip6.addr as lists for libxo encoded output (json, xml).
Instead of providing a comma-separated list, ip4.addr and ip6.addr are
thus represented in the encoding format's natural structure.
This patch also unifies / simplifies the IP presentation format conversion.
The XO_VERSION is not incremented because this patch builds upon a previous one.
New output format:
jls -n all --libxo json
...
"ip4.addr": [
"10.1.1.1",
"10.1.1.2",
"10.1.1.3"
],
"ip4.saddrsel": true,
"ip6.addr": [
"fe80::1000:1",
"fe80::1000:2"
],
...
jls -n all --libxo xml
...
<ip4.addr>10.1.1.1</ip4.addr>
<ip4.addr>10.1.1.2</ip4.addr>
<ip4.addr>10.1.1.3</ip4.addr>
<ip4.saddrsel>true</ip4.saddrsel>
<ip6.addr>fe80::1000:1</ip6.addr>
<ip6.addr>fe80::1000:2</ip6.addr>
...